Socket
Socket
Sign inDemoInstall

libpq

Package Overview
Dependencies
Maintainers
1
Versions
44
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

libpq - npm Package Compare versions

Comparing version 1.2.0 to 1.2.1

5

index.js

@@ -20,2 +20,3 @@ var PQ = module.exports = require('bindings')('addon.node').PQ;

PQ.prototype.connectSync = function(paramString) {
this.connected = true;
if(!paramString) {

@@ -34,2 +35,3 @@ paramString = '';

PQ.prototype.connect = function(paramString, cb) {
this.connected = true;
if(typeof paramString == 'function') {

@@ -60,2 +62,3 @@ cb = paramString;

PQ.prototype.finish = function() {
this.connected = false;
this.$finish();

@@ -252,2 +255,3 @@ };

PQ.prototype.startReader = function() {
assert(this.connected, 'Must be connected to start reader');
this.$startRead();

@@ -262,2 +266,3 @@ };

PQ.prototype.writable = function(cb) {
assert(this.connected, 'Must be connected to start writer');
this.$startWrite();

@@ -264,0 +269,0 @@ return this.once('writable', cb);

2

package.json
{
"name": "libpq",
"version": "1.2.0",
"version": "1.2.1",
"description": "Low-level native bindings to PostgreSQL libpq",

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -8,5 +8,7 @@ var PQ = require('../')

var pq = new PQ();
assert(!pq.connected, 'should have connected set to falsy');
pq.connect(function(err) {
assert.ifError(err);
pq.exec('SELECT NOW()');
assert.equal(pq.connected, true, 'should have connected set to true');
assert.equal(pq.ntuples(), 1);

@@ -13,0 +15,0 @@ done();

@@ -19,2 +19,17 @@ var PQ = require('../')

});
it('throws when reading while not connected', function() {
var pq = new PQ();
assert.throws(function() {
pq.startReader();
});
});
it('throws when writing while not connected', function() {
var pq = new PQ();
assert.throws(function() {
pq.writable(function() {
});
});
});
})

@@ -21,4 +21,9 @@ var PQ = require('../')

it('is connected', function() {
assert(this.pq.connected, 'should have connected == true');
});
after(function() {
this.pq.finish();
assert(!this.pq.connected);
});

@@ -25,0 +30,0 @@ });

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