Skip to content
PostgreSQL query builder
JavaScript
Find file
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.
.gitignore
.travis.yml
LICENSE
README.md
index.js
package.json
test.js

README.md

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

Something went wrong with that request. Please try again.