Skip to content

Latest commit

 

History

History
18 lines (14 loc) · 343 Bytes

README.md

File metadata and controls

18 lines (14 loc) · 343 Bytes

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);
};