Skip to content

vjames19/pgPromise

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

pgPromise Build Status

Returns promises instead of using callbacks.

Getting Started

Install the module with: npm install pgpromise

var pg = require('pg');
var PgPromise = require('pgpromise');

// use connection string or connection config object
var conString = "postgres://postgres:1234@localhost/postgres";
var db = new PgPromise(pg, conString);

// make promised queries.
db.connect().then(function(conn) {
  conn.client.queryP('SELECT * from table').then(function(result) {
    console.log(result.rows);
  }).fin(conn.done); // returns the client to the pool.
});

Documentation

(Coming soon)

Examples

(Coming soon)

Contributing

In lieu of a formal styleguide, take care to maintain the existing coding style. Add unit tests for any new or changed functionality. Lint and test your code using Grunt.

Release History

(Nothing yet)

License

Copyright (c) 2014 Victor J. Reventos. Licensed under the MIT license.

About

Promises for the node-postgres connector.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published