Friday 20 July 2018

node-postgres: safe to use ES6 syntax for query?

Originally, the proper way to use query with parameters is client.query('SELECT * FROM posts WHERE post_id = $1', [id]).Would it be the same (or safe) to use ES6 new quotation syntax?eg.client.query(`SELECT * FROM posts WHERE post_id = ${id}`)

Submitted July 20, 2018 at 09:57PM by eggtart_prince

No comments:

Post a Comment