2010-10-16 07:21:24 +08:00
|
|
|
#pg.js
|
2010-10-17 08:45:05 +08:00
|
|
|
Pure JavaScript PostgreSQL driver for node.js
|
2010-10-16 07:21:24 +08:00
|
|
|
|
2010-10-17 08:45:05 +08:00
|
|
|
## ALPHA version
|
2010-10-16 07:21:24 +08:00
|
|
|
|
2010-10-17 08:45:05 +08:00
|
|
|
Unlike many githubbers this is my only active project. All my
|
2010-10-16 07:21:24 +08:00
|
|
|
free coding time is to be going towards this until it's production
|
2010-10-17 08:45:05 +08:00
|
|
|
ready and stable so watch the repo and stay tuned.
|
|
|
|
|
|
|
|
### What works?
|
|
|
|
|
|
|
|
var client = new Client({
|
|
|
|
username: 'brianc',
|
|
|
|
database: 'postgres'
|
|
|
|
});
|
|
|
|
|
|
|
|
client.connect();
|
|
|
|
|
|
|
|
client.query('select typname, oid from pg_type');
|
2010-10-16 07:21:24 +08:00
|
|
|
|
2010-10-17 08:45:05 +08:00
|
|
|
query.on('row', function(row) {
|
|
|
|
console.log('type name: ' + row[0] + ' oid: ' + row[1]);
|
|
|
|
};
|
2010-09-29 11:09:21 +08:00
|
|
|
|
2010-10-17 08:45:05 +08:00
|
|
|
query.on('end') {
|
|
|
|
client.disconnect();
|
|
|
|
};
|