architect-knex

1.0.2 • Public • Published

architect-knex

Expose knex query builder knex as architect plugin.

Installation

npm install --save architect-knex

Usage

Boot Architect :

var path = require('path');
var architect = require("architect");
 
var config = architect.loadConfig(path.join(__dirname, "config.js"));
 
architect.createApp(config, function (err, app) {
    if (err) {
        throw err;
    }
    console.log("app ready");
});

Configure Architect with config.js to access a SQLite3 in memory database *:

module.exports = [{
    packagePath: "architect-knex",
    settings: {
        default: {
            dialect: 'sqlite3',
            connection: {
                database: ':memory:'
            }
        }
    }
}, './repos'];
  • Don't miss to add sqlite3 in your project dependency

Consume knex plugin in your ./repos/package.json :

{
  "name": "repos",
  "main": "index.js",
  "private": true,
 
  "plugin": {
    "consumes": ["knex"]
  }
}

Readme

Keywords

Package Sidebar

Install

npm i architect-knex

Weekly Downloads

1

Version

1.0.2

License

Apache License V2.0

Last publish

Collaborators

  • gchauvet