node package manager
Don’t reinvent the wheel. Reuse code within your team. Create a free org »

pg-queries

pg-queries

Neat promise and event based access layer around node-postgres.

Installation

npm install pg-queries

Usage

Perform query(-ies) on particular connection.

var pgq = require('pg-queries');
 
pgq.connect().then(function(connection) {
  connection.query("select version()").then(function(rows) {
    // .... 
  });
});

Immediate query.

var pgq = require('pg-queries');
 
pgq.query("select version()").then(function(rows) {
  // .... 
});

License

MIT