Comparing version 0.5.0 to 0.5.1
@@ -34,2 +34,5 @@ var PQ = module.exports = require('bindings')('addon.node').PQ; | ||
assert(cb, 'Must provide a connection callback'); | ||
if(process.domain) { | ||
cb = process.domain.bind(cb); | ||
} | ||
this.$connect(paramString, cb); | ||
@@ -36,0 +39,0 @@ }; |
{ | ||
"name": "libpq", | ||
"version": "0.5.0", | ||
"version": "0.5.1", | ||
"description": "Low-level native bindings to PostgreSQL libpq", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -27,2 +27,15 @@ var PQ = require('../') | ||
}); | ||
it('respects the active domain', function(done) { | ||
var pq = new PQ(); | ||
var domain = require('domain').create(); | ||
domain.run(function() { | ||
var activeDomain = process.domain; | ||
assert(activeDomain, 'Should have an active domain'); | ||
pq.connect(function(err) { | ||
assert.strictEqual(process.domain, activeDomain, 'Active domain is lost'); | ||
done(); | ||
}); | ||
}); | ||
}); | ||
}); |
@@ -41,3 +41,3 @@ var Libpq = require('../'); | ||
assert.equal(err.sourceFile, "parse_target.c"); | ||
assert.equal(err.sourceLine, "510"); | ||
assert(parseInt(err.sourceLine)); | ||
assert.equal(err.sourceFunction, "transformAssignedExpr"); | ||
@@ -44,0 +44,0 @@ }); |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
73421
842