Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

pg

Package Overview
Dependencies
Maintainers
1
Versions
225
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

pg - npm Package Compare versions

Comparing version 0.6.1 to 0.6.2

2

lib/connection.js

@@ -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);
}))
}))
})
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc