How to show sql on console when application running ?
http://knexjs.org/#Installation-debug
Run DEBUG=knex:query
as environment variable.
Or use .toString()
on a knex instance.
And toSQL().toNative() shows query in format that it is sent to sql driver. Also you can hook up printing to knex.on(’query’, ...) event
For the record, the documentation of this:
yourQuery.toSQL().toNative()
is here: http://knexjs.org/#Interfaces-toSQL
Most helpful comment
http://knexjs.org/#Installation-debug
Run
DEBUG=knex:query
as environment variable.Or use
.toString()
on a knex instance.