I am trying to develop functionality using JS/jQuery and Postgres.
From the JS side, we've created functionality to create an Array of the card image and descriptions. The card consists of base64 data and a description.
And now the data is looking like this:
[{"image": "base 64 data of image", "description": "Angular is a platform and framework for building single-page client applications using HTML and TypeScript. Angular is written in TypeScript. It implements core and optional functionality as a set of TypeScript libraries that you import into your applications."}
,{"image": "base 65 data", "description": "Angular is a platform and framework for building single-page client applications using HTML and TypeScript. Angular is written in TypeScript. It implements core and optional functionality as a set of TypeScript libraries that you import into your applications."}....]
And I want to store this type of data in my Postgres. Can I store this in a single array or JSON format? Any other solution is also helpful for me which is faster and more efficient for this type of data.
I tried :
INSERT INTO orb select * from json_populate_recordset(1213360, '[{"img":"base 64 data", "description":"RabbitMQ is a messaging broker - an intermediary for messaging. It gives your applications a common platform to send and receive messages, and your messages a safe place to live until received."}]')
but it is showing me :
ERROR: syntax error at or near "s"
LINE 1: ...//Gpbe66w79i0AAAAASUVORK5CYII=", "description": "It's used for...
^
SQL state: 42601
Character: 632179