Skip to content

Commit

Permalink
docs: Added initial documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
UlisesGascon committed Feb 15, 2021
1 parent cb6297c commit 2425002
Showing 1 changed file with 39 additions and 0 deletions.
39 changes: 39 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -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)

0 comments on commit 2425002

Please sign in to comment.