2.0.0 • Published 1 year ago

systemic-knex v2.0.0

Weekly downloads
8
License
MIT
Repository
github
Last release
1 year ago

☕️ 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

VersionNode.jsKnex
1.0.010.x-14.x0.21.17
2.0.014.x-19.x0.21.17

📚 Parameters

Check out the official documentation

2.0.0

1 year ago

1.0.0

3 years ago