Skip to content

Latest commit

 

History

History
60 lines (43 loc) · 1.58 KB

Readme.md

File metadata and controls

60 lines (43 loc) · 1.58 KB

NPM version Build status Test coverage License Dependency status

pg-then

  • Use postgresql with promise api, based on pg.

Install

$ npm install pg
$ npm install pg-then

Usage

let pg = require('pg-then');

let pool = pg.Pool('postgres://username:password@localhost/database');

pool.query('SELECT ...')
.then(...)
.catch(...);
let pg = require('pg-then');

let client = pg.Client('postgres://username:password@localhost/database');

client.query('SELECT ...')
.then(...)
.catch(...);

// ...

client.end();

License

MIT