I'm new to postgres-node. Coming from a mySQL background, I'm unlearning old habits and now learning new things. I want to prevent SQL injections when inserting data. I read about parameterized query. Is this applicable to JSON type? I'm doing CRUD operations on a table in postgres that only have 2 columns. I'm manipulating JSON data (SELECT, INSERT and UPDATE). How do you prevent SQL injections when inserting JSON data in a table?
table
id | info
1 | { "customer": "John Doe", "items": {"product": "Beer","qty": 6}}'
2 | { "customer": "Lily Bush", "items": {"product": "Diaper","qty": 24}}
query
INSERT INTO orders (info)
VALUES('{ "customer": "Josh William", "items": {"product": "Toy Car","qty": 1}}')
INSERTstatement you quote. Perhaps you should show the code that creates the statement.