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.5.8 to 0.6.0

4

lib/client.js

@@ -1,4 +0,4 @@

var sys = require('sys');
var crypto = require('crypto');
var EventEmitter = require('events').EventEmitter;
var util = require('util');

@@ -27,3 +27,3 @@ var Query = require(__dirname + '/query');

sys.inherits(Client, EventEmitter);
util.inherits(Client, EventEmitter);

@@ -30,0 +30,0 @@ var p = Client.prototype;

@@ -1,5 +0,5 @@

var sys = require('sys');
var net = require('net');
var crypto = require('crypto');
var EventEmitter = require('events').EventEmitter;
var util = require('util');

@@ -22,3 +22,3 @@ var utils = require(__dirname + '/utils');

sys.inherits(Connection, EventEmitter);
util.inherits(Connection, EventEmitter);

@@ -317,3 +317,3 @@ var p = Connection.prototype;

}
throw new Error("Unknown authenticatinOk message type" + sys.inspect(msg));
throw new Error("Unknown authenticatinOk message type" + util.inspect(msg));
};

@@ -320,0 +320,0 @@

var EventEmitter = require('events').EventEmitter;
var sys = require('sys');
var util = require('util');
var Client = require(__dirname+'/client');

@@ -20,3 +19,3 @@ var defaults = require(__dirname + '/defaults');

sys.inherits(PG, EventEmitter);
util.inherits(PG, EventEmitter);

@@ -23,0 +22,0 @@ PG.prototype.end = function() {

//require the c++ bindings & export to javascript
var sys = require('sys');
var EventEmitter = require('events').EventEmitter;
var utils = require(__dirname + "/../utils");
var binding = require(__dirname + '/../../build/default/binding');
var binding;
try{
//v0.5.x
binding = require(__dirname + '/../../build/Release/binding.node');
} catch(e) {
//v0.4.x
binding = require(__dirname + '/../../build/default/binding');
}
var Connection = binding.Connection;

@@ -11,3 +19,7 @@ var types = require(__dirname + "/../types");

var EventEmitter = require('events').EventEmitter;
var p = Connection.prototype;
for(var k in EventEmitter.prototype) {
p[k] = EventEmitter.prototype[k];
}

@@ -14,0 +26,0 @@ var nativeConnect = p.connect;

@@ -1,3 +0,3 @@

var sys = require('sys');
var EventEmitter = require('events').EventEmitter;
var util = require('util');

@@ -55,3 +55,3 @@ var types = require(__dirname + "/../types");

sys.inherits(NativeQuery, EventEmitter);
util.inherits(NativeQuery, EventEmitter);
var p = NativeQuery.prototype;

@@ -58,0 +58,0 @@

var EventEmitter = require('events').EventEmitter;
var sys = require('sys');var sys = require('sys');
var util = require('util');
var Result = require(__dirname + "/result");

@@ -22,3 +23,3 @@ var types = require(__dirname + "/types");

sys.inherits(Query, EventEmitter);
util.inherits(Query, EventEmitter);
var p = Query.prototype;

@@ -25,0 +26,0 @@

var url = require('url');
var defaults = require(__dirname + "/defaults");
var events = require('events');
var sys = require('sys');

@@ -6,0 +5,0 @@ //compatibility for old nodes

{ "name": "pg",
"version": "0.5.8",
"version": "0.6.0",
"description": "PostgreSQL client - pure javascript & libpq with the same API",

@@ -19,3 +19,3 @@ "keywords" : ["postgres", "pg", "libpq", "postgre", "database", "rdbms"],

},
"engines" : { "node": ">= 0.2.2" }
"engines" : { "node": ">= 0.4.0" }
}

@@ -8,2 +8,5 @@ #node-postgres

npm install pg
### notice
node-postgres compiles native bindings when you install. The native bindings do not _currently_ compile with node v0.5.x. I'm working on support for v0.5.x. In the mean time if you get a compilation failure during installation you have still successfully installed the module; however, you cannot use the native bindings -- only the pure javascript bindings.

@@ -10,0 +13,0 @@ ## Examples

@@ -1,2 +0,2 @@

var sys = require('sys');
var sys = require('utils');
var args = require(__dirname + '/../test/cli');

@@ -3,0 +3,0 @@ var pg = require(__dirname + '/../lib');

@@ -34,3 +34,3 @@ var helper = require(__dirname + '/../test-helper');

client.query("SELECT * FROM band WHERE name = 'the beach boys'", assert.calls(function(err, result) {
assert.length(result.rows, 1)
assert.lengthIs(result.rows, 1)
assert.equal(result.rows.pop().name, 'the beach boys')

@@ -46,3 +46,3 @@ log("simple query executed")

log("Prepared statement 1 finished")
assert.length(result.rows, 1);
assert.lengthIs(result.rows, 1);
assert.equal(result.rows.pop().name, 'dead black hearts');

@@ -54,3 +54,3 @@ }))

log("prepared statement two finished")
assert.length(result.rows, 2);
assert.lengthIs(result.rows, 2);
assert.equal(result.rows.pop().name, 'the flaming lips');

@@ -57,0 +57,0 @@ assert.equal(result.rows.pop().name, 'the beach boys');

@@ -13,3 +13,3 @@ var helper = require(__dirname + "/test-helper");

client.query('SELECT numbors FROM why', assert.success(function(result) {
assert.length(result.rows[0].numbors, 3);
assert.lengthIs(result.rows[0].numbors, 3);
assert.equal(result.rows[0].numbors[0], 1);

@@ -24,3 +24,3 @@ assert.equal(result.rows[0].numbors[1], 2);

var names = result.rows[0].names;
assert.length(names, 3);
assert.lengthIs(names, 3);
assert.equal(names[0], 'aaron');

@@ -27,0 +27,0 @@ assert.equal(names[1], 'brian');

@@ -57,3 +57,3 @@ var helper = require(__dirname+"/test-helper");

}
assert.length(result.rows, 26);
assert.lengthIs(result.rows, 26);
});

@@ -65,3 +65,3 @@ q.on('row', function(row) {

//query ended
assert.length(rows, 26);
assert.lengthIs(rows, 26);
})

@@ -68,0 +68,0 @@ }

var helper = require(__dirname + '/test-helper');
var sys = require('sys');
var util = require('util');

@@ -7,3 +7,3 @@ var createErorrClient = function() {

client.on('error', function(err) {
assert.ok(false, "client should not throw query error: " + sys.inspect(err));
assert.ok(false, "client should not throw query error: " + util.inspect(err));
});

@@ -119,2 +119,3 @@ client.on('drain', client.end.bind(client));

test('when connecting to invalid host', function() {
return false;
var client = new Client({

@@ -130,2 +131,3 @@ user: 'brian',

test('when connecting to invalid host with callback', function() {
return false;
var client = new Client({

@@ -132,0 +134,0 @@ user: 'brian',

@@ -22,3 +22,3 @@ var helper = require(__dirname+"/test-helper");

if ('length' in row) {
assert.length(row, columnCount, 'Iterating through the columns gives a different length from calling .length.');
assert.lengthIs(row, columnCount, 'Iterating through the columns gives a different length from calling .length.');
}

@@ -30,3 +30,3 @@ });

test("returned right number of rows", function() {
assert.length(rows, 26);
assert.lengthIs(rows, 26);
});

@@ -33,0 +33,0 @@ test("row ordering", function(){

@@ -27,5 +27,5 @@ var helper = require(__dirname + "/../test-helper");

//check to make sure client connection actually was killed
assert.length(res.rows, 1);
assert.lengthIs(res.rows, 1);
}));
}));
}));

@@ -18,3 +18,3 @@ var helper = require(__dirname + "/../test-helper");

client.query("select * from person", function(err, result) {
assert.length(result.rows, 26)
assert.lengthIs(result.rows, 26)
})

@@ -21,0 +21,0 @@ client.query("select count(*) as c from person", function(err, result) {

@@ -14,3 +14,3 @@ var helper = require(__dirname + "/../test-helper");

client.end();
assert.length(rows, 26);
assert.lengthIs(rows, 26);
})

@@ -17,0 +17,0 @@ });

@@ -5,3 +5,3 @@ //make assert a global...

var EventEmitter = require('events').EventEmitter;
var sys = require('sys');
var sys = require('util');
var BufferList = require(__dirname+'/buffer-list')

@@ -97,3 +97,3 @@

assert.empty = function(actual) {
assert.length(actual, 0);
assert.lengthIs(actual, 0);
};

@@ -121,3 +121,3 @@

assert.length = function(actual, expectedLength) {
assert.lengthIs = function(actual, expectedLength) {
assert.equal(actual.length, expectedLength);

@@ -124,0 +124,0 @@ };

@@ -11,3 +11,3 @@ require(__dirname+'/test-helper');

var packets = client.connection.stream.packets;
assert.length(packets, 1);
assert.lengthIs(packets, 1);
var packet = packets[0];

@@ -14,0 +14,0 @@ assert.equalBuffers(packet, [0x70, 0, 0, 0, 6, 33, 0]);

@@ -9,3 +9,3 @@ require(__dirname + '/test-helper')

test('responds', function() {
assert.length(client.connection.stream.packets, 1);
assert.lengthIs(client.connection.stream.packets, 1);
test('should have correct encrypted data', function() {

@@ -12,0 +12,0 @@ var encrypted = Client.md5(client.password + client.user);

@@ -67,3 +67,3 @@ var helper = require(__dirname + '/test-helper');

assert.equal(bindArg.portal, null);
assert.length(bindArg.values, 1);
assert.lengthIs(bindArg.values, 1);
assert.equal(bindArg.values[0], 'hi')

@@ -70,0 +70,0 @@ });

@@ -10,3 +10,3 @@ var helper = require(__dirname + "/test-helper")

var query = client.query("whatever");
assert.length(client.connection.queries, 1)
assert.lengthIs(client.connection.queries, 1)

@@ -13,0 +13,0 @@ assert.emits(query, 'end', function(result) {

@@ -12,3 +12,3 @@ var helper = require(__dirname + "/test-helper");

client.query('yes');
assert.length(client.connection.queries, 1);
assert.lengthIs(client.connection.queries, 1);
assert.equal(client.connection.queries, 'yes');

@@ -27,3 +27,3 @@ });

assert.ok(client.connection.emit('readyForQuery'));
assert.length(client.connection.queries, 1);
assert.lengthIs(client.connection.queries, 1);
assert.equal(client.connection.queries[0], "boom");

@@ -45,3 +45,3 @@ });

connection.emit('readyForQuery');
assert.length(queries, 1);
assert.lengthIs(queries, 1);
assert.equal(queries[0], "one");

@@ -52,3 +52,3 @@ });

connection.emit('readyForQuery');
assert.length(queries, 2);
assert.lengthIs(queries, 2);
});

@@ -60,3 +60,3 @@

connection.emit('readyForQuery');
assert.length(queries, 3);
assert.lengthIs(queries, 3);
assert.equal(queries[0], "one");

@@ -80,3 +80,3 @@ assert.equal(queries[1], 'two');

con.emit('readyForQuery');
assert.length(con.queries, 1);
assert.lengthIs(con.queries, 1);
assert.equal(con.queries[0], 'whatever');

@@ -83,0 +83,0 @@ });

@@ -370,3 +370,3 @@ require(__dirname+'/test-helper');

stream.emit('data', fullBuffer);
assert.length(message.fields, 5);
assert.lengthIs(message.fields, 5);
assert.equal(message.fields[0], null);

@@ -386,3 +386,3 @@ assert.equal(message.fields[1], "bang");

stream.emit('data', secondBuffer);
assert.length(message.fields, 5);
assert.lengthIs(message.fields, 5);
assert.equal(message.fields[0], null);

@@ -430,3 +430,3 @@ assert.equal(message.fields[1], "bang");

var verifyMessages = function() {
assert.length(messages, 2);
assert.lengthIs(messages, 2);
assert.same(messages[0],{

@@ -433,0 +433,0 @@ name: 'dataRow',

@@ -9,3 +9,3 @@ require(__dirname + "/test-helper");

assert.received = function(stream, buffer) {
assert.length(stream.packets, 1);
assert.lengthIs(stream.packets, 1);
var packet = stream.packets.pop();

@@ -12,0 +12,0 @@ assert.equalBuffers(packet, buffer);

Sorry, the diff of this file is not supported yet

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