@rappopo/dab-knex

0.6.9 • Public • Published

@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

Donation

  • Donate
  • Bitcoin 16HVCkdaNMvw3YdBYGHbtt3K5bmpRmH74Y

License

MIT

/@rappopo/dab-knex/

    Package Sidebar

    Install

    npm i @rappopo/dab-knex

    Weekly Downloads

    1

    Version

    0.6.9

    License

    MIT

    Unpacked Size

    64.2 kB

    Total Files

    22

    Last publish

    Collaborators

    • rappopo