ak-pg

0.0.1 • Public • Published

node-postgres-akiban

PostgreSQL client extended for Akiban features.

Examples

Nested Result Set

var akpg = require('ak-pg');

akpg.connect('postgres://guest:guest@localhost:15432/guest', function(err, client) {
               if (client == null) {
                 console.log(err);
               }
               else {
                 var query = client.query("SELECT 1 AS n, true AS bool, 'abc' AS s, X'010203' AS bin, CURRENT_DATE AS today, CURRENT_TIMESTAMP AS now, (SELECT schema_name FROM information_schema.schemata) AS schemas");
                 query.on('end', function() {
                            client.end();
                          });
                 query.on('row', function(row) {
                            console.log(row);
                          });
               }
             });
{ n: 1,
  bool: true,
  s: 'abc',
  bin: <Buffer 01 02 03>,
  today: Sun Apr 07 2013 20:00:00 GMT-0400 (EDT),
  now: Mon Apr 08 2013 10:55:31 GMT-0400 (EDT),
  schemas: 
   [ { schema_name: 'information_schema' },
     { schema_name: 'guest' },
     { schema_name: 'security_schema' },
     { schema_name: 'sqlj' },
     { schema_name: 'sys' } ] }

/ak-pg/

    Package Sidebar

    Install

    npm i ak-pg

    Weekly Downloads

    1

    Version

    0.0.1

    License

    none

    Last publish

    Collaborators

    • mmcm