When a valid SQL string is taken and used without proper escaping, it can be used to inject SQL commands into the database.
Postgres we essentially need to set a statement as a string and have values passed that are subbed in.
Don't do this:
const { rows } = await pool.query(` SELECT * FROM users WHERE id = ${id}; `);
Do this:
const { rows } = await pool.query( ` SELECT * FROM users WHERE id = $1; `, [id] );