Skip to content

omninews/pg-easy

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 

Repository files navigation

pg-easy

Usage

const pg = require('pg-easy');
const conStr = 'postgres://localhost:5432';

exports.db = pg.create({conStr: conStr}, {
  getStuff: `select * from stuff
              offset $1
              limit $2;`
});

exports.getStuff = (offset, limit) => {
  return db.getStuff(offset, limit).then(result => result.rows);
};

About

Remove the boilerplate of setting up node-pg

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published