Skip to content

executing complete insert #650

Closed Answered by porsager
MarcRohrer asked this question in Q&A
Discussion options

You must be logged in to vote

Hi @MarcRohrer .

If you already have a string you want to run as a query, there is no way to have Postgres.js help you ensure you're doing something safe, and not accidentally eg. allowing sql injection, therefore the method is called unsafe. Check out https://github.com/porsager/postgres#await-sqlunsafequery-args-options---result

Postgres.js mainly works by letting you compose your queries using tagged template literals, also to avoid sql injection and unsafe query creation. Did you read the beginning of the README.md, specifically https://github.com/porsager/postgres#await-sql---result ? Do you have any recommendations for how you think it could be better explained? I'm sorry to hear yo…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@MarcRohrer
Comment options

Answer selected by MarcRohrer
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants