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

pg.js

Package Overview
Dependencies
Maintainers
1
Versions
30
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

pg.js - npm Package Compare versions

Comparing version 2.10.0 to 2.11.0

27

lib/client.js

@@ -55,6 +55,3 @@ var crypto = require('crypto');

} else {
con.startup({
user: self.user,
database: self.database
});
con.startup(self.getStartupConf());
}

@@ -64,6 +61,3 @@ });

con.on('sslconnect', function() {
con.startup({
user: self.user,
database: self.database
});
con.startup(self.getStartupConf());
});

@@ -199,2 +193,19 @@

Client.prototype.getStartupConf = function() {
var params = this.connectionParameters;
var data = {
user : params.user ,
database : params.database
// client_encoding : "'".concat(params.client_encoding).concat("'")
};
var appName = params.application_name || params.fallback_application_name;
if (appName) {
data.application_name = appName;
}
return data;
};
Client.prototype.cancel = function(client, query) {

@@ -201,0 +212,0 @@ if(client.activeQuery == query) {

@@ -6,5 +6,13 @@ var dns = require('dns');

var val = function(key, config) {
var val = function(key, config, envVar) {
if (envVar === undefined) {
envVar = process.env[ 'PG' + key.toUpperCase() ];
} else if (envVar === false) {
// do nothing ... use false
} else {
envVar = process.env[ envVar ];
}
return config[key] ||
process.env['PG' + key.toUpperCase()] ||
envVar ||
defaults[key];

@@ -26,2 +34,10 @@ };

config = {};
if (result.query.application_name) {
config.application_name = result.query.application_name;
}
if (result.query.fallback_application_name) {
config.fallback_application_name = result.query.fallback_application_name;
}
if(result.protocol == 'socket:') {

@@ -73,2 +89,5 @@ config.host = decodeURI(result.pathname);

this.isDomainSocket = (!(this.host||'').indexOf('/'));
this.application_name = val('application_name', config, 'PGAPPNAME');
this.fallback_application_name = val('fallback_application_name', config, false);
};

@@ -88,2 +107,5 @@

add(params, this, 'port');
add(params, this, 'application_name');
add(params, this, 'fallback_application_name');
if(this.database) {

@@ -90,0 +112,0 @@ params.push("dbname='" + this.database + "'");

@@ -120,12 +120,15 @@ var net = require('net');

Connection.prototype.startup = function(config) {
var bodyBuffer = this.writer
var writer = this.writer
.addInt16(3)
.addInt16(0)
.addCString('user')
.addCString(config.user)
.addCString('database')
.addCString(config.database)
.addCString('client_encoding')
.addCString("'utf-8'")
.addCString('').flush();
;
Object.keys(config).forEach(function(key){
var val = config[key];
writer.addCString(key).addCString(val);
});
writer.addCString('client_encoding').addCString("'utf-8'");
var bodyBuffer = writer.addCString('').flush();
//this message is sent without a code

@@ -132,0 +135,0 @@

@@ -41,3 +41,6 @@ var defaults = module.exports = {

ssl: false
ssl: false,
application_name : undefined,
fallback_application_name: undefined
};

@@ -44,0 +47,0 @@

@@ -72,2 +72,3 @@ var arrayParser = require(__dirname + "/arrayParser.js");

}
return date;

@@ -74,0 +75,0 @@ };

{
"name": "pg.js",
"version": "2.10.0",
"version": "2.11.0",
"description": "node-postgres without the bindings",

@@ -9,2 +9,7 @@ "main": "index.js",

},
"homepage": "http://github.com/brianc/node-postgres-pure",
"repository": {
"type": "git",
"url": "git://github.com/brianc/node-postgres-pure.git"
},
"author": "Brian M. Carlson",

@@ -11,0 +16,0 @@ "license": "MIT",

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