From 24250025fc5de1e5001e8a0025dd46f849fbd034 Mon Sep 17 00:00:00 2001 From: Ulises Gascon Date: Mon, 15 Feb 2021 13:07:29 +0100 Subject: [PATCH] docs: Added initial documentation --- README.md | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) diff --git a/README.md b/README.md index c655acb..5ee2c3e 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,41 @@ # systemic-knex A systemic Knex component + +## Usage +```js +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 + }) +``` + +### Parameters + + +Check out [the official documentation](http://knexjs.org/#Installation-client)