🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
Book a DemoInstallSign in
Socket

pg-promise

Package Overview
Dependencies
Maintainers
1
Versions
636
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

pg-promise - npm Package Compare versions

Comparing version

to
0.5.7

32

index.js

@@ -372,3 +372,8 @@ // Cannot declare 'use strict' here, because queryResult

}
func(client, req.query, params); // notify the client;
try {
func(client, req.query, params); // notify the client;
} catch (err) {
reject(err);
return;
}
}

@@ -589,23 +594,12 @@ try {

function $notify(open, db, opt) {
if (open) {
if (opt) {
var func = opt.connect;
if (func) {
if (typeof(func) !== 'function') {
throw new Error("Function was expected for 'options.connect'");
}
func(db.client); // notify the client;
if (opt) {
var func = open ? opt.connect : opt.disconnect;
if (func) {
if (typeof(func) !== 'function') {
throw new Error("Function was expected for 'options." + (open ? "connect'" : "disconnect'"));
} else {
func(db.client);
}
}
} else {
if (opt) {
var func = opt.disconnect;
if (func) {
if (typeof(func) !== 'function') {
throw new Error("Function was expected for 'options.disconnect'");
}
func(db.client); // notify the client;
}
}
}
}
{
"name": "pg-promise",
"version": "0.5.6",
"version": "0.5.7",
"description": "PG + Promises/A+, with transactions support.",

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

@@ -466,2 +466,6 @@ pg-promise

Notification happens just before the query execution. And if the notification handler throws
an error, the query execution will be intercepted and rejected with the error that's been
thrown by the handler function.
The function receives the following parameters:

@@ -468,0 +472,0 @@ * `client` - object from the [PG] library that represents the connection;