serviser-knex
v3.0.1
Published
integrates knex SQL query builder with serviser based projects
Downloads
3
Maintainers
Readme
serviser plugin which integrates Knex
const Service = require('serviser');
const config = require('serviser-config');
const knexBuilder = require('serviser-knex');
const knex = knexBuilder({/*knex options*/});
const service = new Service(config);
//enables integrity inspection features
service.resourceManager.register('postgres', knex);
Define minimum required db server version:
const knex = knexBuilder({
client: 'postgres',
version: '10.5.0'
});
if the defined version requirement isn't satisfied, the service initialization process will fail with an error.
SQL query debugging:
> export SQL_DEBUG=1
> npm start
Tests
npm test