Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/bimedia-fr/architect-knex
Expose KnexJS query builder to architect framework
https://github.com/bimedia-fr/architect-knex
Last synced: 8 days ago
JSON representation
Expose KnexJS query builder to architect framework
- Host: GitHub
- URL: https://github.com/bimedia-fr/architect-knex
- Owner: bimedia-fr
- License: apache-2.0
- Created: 2014-10-20T15:22:42.000Z (about 10 years ago)
- Default Branch: master
- Last Pushed: 2015-06-25T07:58:03.000Z (over 9 years ago)
- Last Synced: 2024-12-06T18:50:54.020Z (29 days ago)
- Language: JavaScript
- Homepage:
- Size: 223 KB
- Stars: 1
- Watchers: 11
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
architect-knex
=================Expose knex query builder *knex* as architect plugin.
### Installation
```sh
npm install --save architect-knex
```### Usage
Boot [Architect](https://github.com/c9/architect) :
```js
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 *:
```js
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` :```js
{
"name": "repos",
"main": "index.js",
"private": true,"plugin": {
"consumes": ["knex"]
}
}
```