Closed Ben-CA closed 1 year ago
Yes, you can do it using the tagged template literal support. eg:
const pool = new ConnectionPool(config);
const req = pool.request();
const query = req.query`select * from [table] where id in (${[1,2,3]})`
query.then((res) => console.log(res);
Great - thanks!
Might be something to consider adding some clarity on in the documentation.
This isn't an "issue" as much as a "question" (and if there isn't an answer, then it sort of is an issue).
I've posted on Stack Overflow asking if this setup has the ability to bind parameters with array values?
https://stackoverflow.com/questions/77404232/binding-dynamic-array-parameter-values-for-sql-with-nodejs
But so far I'm not getting any responses. Including it here for visibility.
I've reviewed the documentation and am not seeing anything regarding this.