2.0.0 • Published 8 years ago

@motiz88/pg-then v2.0.0

Weekly downloads
1
License
MIT
Repository
github
Last release
8 years ago

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

const pg = require('pg-then')

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

pool
  .query('SELECT ...')
  .then(...)
  .catch(...)
pg.Pool(config)
  .stream('SELECT ...')
  .on('data', data => ...)
  .on('end', () => ...)
  .on('error', err => ...)
const pg = require('pg-then')

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

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

// ...

client.end()

License

MIT

2.0.0

8 years ago

1.2.4

8 years ago

1.2.3

8 years ago

1.2.2

8 years ago

1.2.1

8 years ago