node package manager
Share your code. npm Orgs help your team discover, share, and reuse code. Create a free org ยป


EasyDBI-Pg - Postgres Database Adapter for EasyDBI

EasyDBI is a simple database interface for NodeJS. easydbi-pg is the postgresql database adapter for easydbi.


npm install easydbi
npm install easydbi-pg


See EasyDBI for more details on the API.

var DBI = require('easydbi'); // already comes with sqlite3
require('easydbi-pg'); // for pg

DBI.setup('test', {type: 'pg', options: {database: 'test', user: 'test', password: 'test', host: 'localhost', port: 5432})

// "prepare" queries. 
DBI.prepare('test', 'createTest', {exec: 'create table test_t (c1 int, c2 int)'});

DBI.connect('test', function(err, conn) { /* ... */ });