Comparing version 0.6.1 to 0.6.2
@@ -135,3 +135,3 @@ var net = require('net'); | ||
var val = values[i]; | ||
if(val === null) { | ||
if(val === null || typeof val === "undefined") { | ||
buffer.addInt32(-1); | ||
@@ -138,0 +138,0 @@ } else { |
{ "name": "pg", | ||
"version": "0.6.1", | ||
"version": "0.6.2", | ||
"description": "PostgreSQL client - pure javascript & libpq with the same API", | ||
@@ -13,3 +13,3 @@ "keywords" : ["postgres", "pg", "libpq", "postgre", "database", "rdbms"], | ||
"dependencies" : { | ||
"generic-pool" : "1.0.6" | ||
"generic-pool" : "1.0.7" | ||
}, | ||
@@ -16,0 +16,0 @@ "scripts" : { |
@@ -119,2 +119,3 @@ #node-postgres | ||
* [homme](https://github.com/homme) | ||
* [bdunavant](https://github.com/bdunavant) | ||
@@ -121,0 +122,0 @@ ## Documentation |
@@ -143,1 +143,19 @@ var helper = require(__dirname + '/../test-helper'); | ||
}) | ||
test('null and undefined are both inserted as NULL', function() { | ||
pg.connect(connectionString, assert.calls(function(err, client) { | ||
assert.isNull(err); | ||
client.query("CREATE TEMP TABLE my_nulls(a varchar(1), b varchar(1), c integer, d integer, e date, f date)"); | ||
client.query("INSERT INTO my_nulls(a,b,c,d,e,f) VALUES ($1,$2,$3,$4,$5,$6)", [ null, undefined, null, undefined, null, undefined ]); | ||
client.query("SELECT * FROM my_nulls", assert.calls(function(err, result) { | ||
assert.isNull(err); | ||
assert.equal(result.rows.length, 1); | ||
assert.isNull(result.rows[0].a); | ||
assert.isNull(result.rows[0].b); | ||
assert.isNull(result.rows[0].c); | ||
assert.isNull(result.rows[0].d); | ||
assert.isNull(result.rows[0].e); | ||
assert.isNull(result.rows[0].f); | ||
})) | ||
})) | ||
}) |
197175
5246
164
+ Addedgeneric-pool@1.0.7(transitive)
- Removedgeneric-pool@1.0.6(transitive)
Updatedgeneric-pool@1.0.7