2

Ruby on Rails allows seeing a log of the queries made to the database in all environments (dev, test, production). Is there a way one can replicate such functionality in Adonis.js?

TrebledJ
  • 8,713
  • 7
  • 26
  • 48
rfrm
  • 228
  • 2
  • 9

2 Answers2

4

I'm not sure about older versions of Adonis, but in 4 you can set debug option to true in your config/database.js:

mysql: {
  client: 'mysql2',
  connection: {
    ...
  },
  debug: true // here!
},

More here: https://adonisjs.com/docs/4.1/database#_debugging

Footniko
  • 2,682
  • 2
  • 27
  • 36
1

Running tests with $ DEBUG=knex* yarn test will display information about the queries being made.

rfrm
  • 228
  • 2
  • 9