0.6.9 • Published 5 years ago
@rappopo/dab-knex v0.6.9
@rappopo/dab-knex
A Rappopo DAB implementation for Knex
Installation
Simply invoke this command in your project folder:
$ npm install --save @rappopo/dab-knex
Don't forget to also install the needed client library, e.g (if you choose to use sqlite3):
$ npm install sqlite3
And within your script:
const DabKnex = require('@rappopo/dab-knex')
const dab = new DabKnex({
client: 'sqlite3',
connection: {
filename: '/tmp/mydb.sqlite3'
}
})
// prepare collections
dab.createCollection({ name: 'test' })
.then(result => {
return dab.bulkCreate(data, { collection: 'test' })
})
...
// lets dab!
dab.findOne('my-doc', 'test').then(function(doc) { ... })
Options
client
: your Knex's client database library
connection
: your Knex's connection settings
Features
- find
- findOne
- create
- update
- remove
- bulkCreate
- bulkUpdate
- bulkRemove
- copyFrom
- copyTo
- createCollection
- renameCollection
- removeCollection
Donation
License
0.6.9
5 years ago
0.6.8
5 years ago
0.6.7
5 years ago
0.6.6
5 years ago
0.6.5
5 years ago
0.6.4
5 years ago
0.6.3
5 years ago
0.6.2
6 years ago
0.6.1
6 years ago
0.5.1
6 years ago
0.5.0
6 years ago
0.4.0
6 years ago
0.3.0
6 years ago
0.2.3
6 years ago
0.2.2
6 years ago
0.2.1
6 years ago
0.2.0
6 years ago
0.1.2
6 years ago
0.1.1
6 years ago
0.1.0
6 years ago
0.0.7
6 years ago
0.0.6
6 years ago
0.0.5
6 years ago
0.0.4
6 years ago
0.0.3
6 years ago
0.0.2
6 years ago
0.0.1
6 years ago