esquerybuilderpg
v1.0.24
Published
PostgreSQL integrator
Downloads
2
Readme
Total.js QueryBuilder: PostgreSQL
A simple QueryBuilder integrator for PostgreSQL database.
- Documentation
$ npm install querybuilderpg
Initialization
- Example:
postgresql://user:password@localhost:5432/database
// require('querybuilderpg').init(name, connectionstring, pooling, [errorhandling]);
// name {String} a name of DB (default: "default")
// connectionstring {String} a connection to the PostgreSQL
// pooling {Number} max. clients (default: "0" (disabled))
// errorhandling {Function(err, cmd)}
require('querybuilderpg').init('default', CONF.database);
// require('querybuilderpg').init('default', CONF.database, 10);
Usage:
DATA.find('tbl_user').where('id', 1234).callback(console.log);
Connection string attributes
- Connection string example:
postgresql://user:password@localhost:5432/database?schema=parking&pooling=2
schema=String
sets a default DB schemapooling=Number
sets a default pooling (it overwrites pooling)