What is the default version used by Knex.js for the mysql client when no value specified

时间:2019-04-16 23:34:11

标签: mysql knex.js

The Knex.js documentation allows for a version to be set when using a client, in my case I'm using mysql, something like this:

  client: 'mysql',
  version: '5.7',
  connection: {
    host : '127.0.0.1',
    user : 'your_database_user',
    password : 'your_database_password',
    database : 'myapp_test'
  }
});

If I don't specify a value for version what default value will it use?

1 个答案:

答案 0 :(得分:1)

Per source code: https://github.com/tgriesser/knex/blob/master/src/client.js#L53

"version" exists for reference only, whichever version of mysql you're connecting to will be used.

As for which versions of MySql that are supported by knex, I'd direct you to their docs: https://knexjs.org/