pg-query-bluebird
Simplified postgres querying with bluebird
Description
Run queries with node-postgres with less boilerplate. Similar to pg-query but uses bluebird.
Basic Usage
You'll have to install pg separately
var query = ; ;
API
Query rows
Promise<Array<Object>> query(String text | Object query | Array<Object> queries, [Array<dynamic> values])
Query the db, returns an array of rows.
Query single row
Promise<Object> query.single(String text | Object query | Array<Object> queries, [Array<dynamic> values])
Query a single row.
pg
query
Original Promise<Object> query.raw(String text | Object query | Array<Object> queries, [Array<dynamic> values])
Query the db, returns a full result result.rows
,...
Connect
Disposer query.connect([String connStr | Object connParams])
Disposer to use with bluebird's Promise.using
. Automatically releases the client back to the pool after use.
var Promise = ;var query = ; var CONN_STR = '...'; var rows = Promise;
History
1.0.0
- update to bluebird 3