In mssql,
ES6 Tagged template literals uses this syntax:
return sql.query`select * from mytable where id = ${value}`
Input uses this syntax:
request.input('input_parameter', sql.Int, value)
In terms of benefit, there is a one thing that I see using Input over Tagged template literals. It is the data type specification. However, both can prevent SQL injection from what I understand.
My question is what are the other differences between ES6 Tagged template literals and Input if any? because if there is none then I think using input is just better. I’m in a process to decide which one to use as a standard way of coding this.