2.0.0 • Published 1 year ago
systemic-knex v2.0.0
☕️ Usage
const System = require('systemic')
const knex = require('systemic-knex')
new System()
.configure({
knex: {
// @SEE: http://knexjs.org/#Installation-client
client: 'mysql',
connection: {
host: 'localhost',
user: 'root',
password: 'password',
database: 'database_name'
},
// Optional Config (pool, migrations, seeds...):
pool: {},
migrations: {
tableName: 'knex_migrations',
directory: join(__dirname, '..', '/db/migrations')
},
seeds: {
directory: join(__dirname, '..', '/db/seeds')
}
}
})
.add('logger', console)
.add('knex', knex()).dependsOn('config')
.start((err, components) => {
// Do stuff with components.knex
})
🚩 Compatibility versions
Version | Node.js | Knex |
---|---|---|
1.0.0 | 10.x-14.x | 0.21.17 |
2.0.0 | 14.x-19.x | 0.21.17 |
📚 Parameters
Check out the official documentation