From 8b9e97f5b93585defec94c3ba16375fefb8fde8f Mon Sep 17 00:00:00 2001 From: brianc Date: Tue, 4 Dec 2012 17:53:04 -0600 Subject: [PATCH] update version of node-pool closes gh #223 added integration test to catch any future regressions --- index.js | 13 +++++++++++++ package.json | 4 ++-- test/integration/client/api-tests.js | 5 +++++ 3 files changed, 20 insertions(+), 2 deletions(-) create mode 100644 index.js diff --git a/index.js b/index.js new file mode 100644 index 0000000..0a57cbe --- /dev/null +++ b/index.js @@ -0,0 +1,13 @@ +var pg = require('./lib') + +var Client = pg.Client; + +pg.connect('pg://localhost/postgres', function(err, client) { + console.log(err) +}) + + +new Client({database: 'postgres'}).connect(function(err) { + console.log(err); + console.log('connected') +}) diff --git a/package.json b/package.json index 628dd6b..3a0e1df 100644 --- a/package.json +++ b/package.json @@ -1,5 +1,5 @@ { "name": "pg", - "version": "0.8.8", + "version": "0.9.0", "description": "PostgreSQL client - pure javascript & libpq with the same API", "keywords" : ["postgres", "pg", "libpq", "postgre", "database", "rdbms"], "homepage": "http://github.com/brianc/node-postgres", @@ -10,7 +10,7 @@ "author" : "Brian Carlson ", "main" : "./lib", "dependencies" : { - "generic-pool" : "1.0.12" + "generic-pool" : "2.0.2" }, "scripts" : { "test" : "make test-all connectionString=pg://postgres@localhost:5432/postgres", diff --git a/test/integration/client/api-tests.js b/test/integration/client/api-tests.js index 0fd9410..de572d2 100644 --- a/test/integration/client/api-tests.js +++ b/test/integration/client/api-tests.js @@ -16,6 +16,11 @@ var sink = new helper.Sink(5, 10000, function() { test('api', function() { log("connecting to %j", helper.config) + //test weird callback behavior with node-pool + pg.connect(helper.config, function(err) { + assert.isNull(err); + arguments[1].emit('drain'); + }); pg.connect(helper.config, assert.calls(function(err, client) { assert.equal(err, null, "Failed to connect: " + helper.sys.inspect(err));