Miss any of our Open RFC calls?Watch the recordings here! »

ezpg

0.2.0 • Public • Published

ezpg Build Status

var ezpg = require('ezpg');
 
 
ezpg.connection(function(err, client, done){
    // normal pq stuff
    client.query('select 1;', function(err, result){
        //done()
    });
 
    // ez'er pg function
    client.func('pg_database_size', ['template1'], function(err, result){
        console.log('your db is ' + result[0] + 'bytes.');
        done();
    });
});
 
ezpg.transaction(function(err, client, commit, rollback){
    client.query('create table relay.thisismynewtabkldasfadsfdsfads(id smallint);', function(err, result){
        
        // jk
        rollback();
    });
});

Install

npm i ezpg

DownloadsWeekly Downloads

9

Version

0.2.0

License

MIT

Last publish

Collaborators

  • avatar