I am starting a project with sails and mysql, and I do'nt know how configurate it to show the queries executed in the console.
This solution works for sails >= 1.1.
The sails-mysql
(as of v1.0.0) adapter uses the machinepack-mysql
driver which logs queries to debug
. So all that's needed to log all native queries is to enable the debug flag:
DEBUG=query node app.js
Unfortunately this isn't possible with Sails at this time, although the feature has been requested. Your best bet is to inspect the log file provided by your database:
Postgres: How to log PostgreSQL queries?
MySQL: Log all queries in mysql
MongoDB: MongoDB logging all queries
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With