Closed JonathanHolvey closed 3 years ago
You need to just put it as an argument. The ? Syntax is a copy from mysql placeholder syntax, which also has no way to escape it. Example:
const { format } = require('sqlstring')
format(`select * from mytable where foo = ? and bar = ?`, ['https://example.com?a=b', 'xyz'])
If I use the
format
function on a query that contains a literal?
this gets replaced, as per the documentation. How can I escape the?
character so it doesn't get replaced?The resulting output from this would be
whereas I want