Maybe a stupid question, but I haven't been able to find an answer combing through the docs, google, and the issues:
How can I console.log each sql statement executed? (for debugging purposes, of course).
I usually use Sequelize, and with Sequelize it is just a matter of setting config.logging = true (or a custom function if you want). But I don't see anything that can do the same thing just using mssql.
node-mssql uses the debug package (with 'mssql:tedious' or 'mssql:msnodesql') so you can do DEBUG=mssql:* node app.js to make it print the sql statements.
Example output:
mssql:tedious req: query: SELECT * FROM TestTable WHERE TestColumn = @Value +0ms
mssql:tedious req: query ok +328ms
Most helpful comment
node-mssql uses the debug package (with 'mssql:tedious' or 'mssql:msnodesql') so you can do
DEBUG=mssql:* node app.jsto make it print the sql statements.Example output: