pg-builder

PostgreSQL query builder

npm install pg-builder
2 downloads in the last day
21 downloads in the last week
41 downloads in the last month

pg-builder

PostgreSQL query builder

Build Status

Installation

npm install pg-builder

Usage

var q = require('pg-builder')()
.select('user_id', 'username')
.select('age')
.from('users')
.where('age >= ${minAge}')
.order('username', 'asc')
.limit(500)
.param('minAge', 27)

console.log(q.text)
console.log(q.values)

/*
SELECT user_id, username, age
FROM users
WHERE age >= $1
ORDER BY username
LIMIT 500
[ 27 ]
*/

See tests for more

npm loves you