Merge pull request #604 from markyen/socket-port

Include port as a connection parameter for socket connections
This commit is contained in:
Brian C 2014-07-06 19:24:09 -04:00
commit 8592be7176
2 changed files with 4 additions and 2 deletions

View File

@ -3,3 +3,5 @@ node_js:
- "0.10"
before_script:
- node script/create-test-tables.js pg://postgres@127.0.0.1:5432/postgres
before_install:
- npm install -g npm@~1.4.6

View File

@ -39,6 +39,7 @@ var parse = function(str) {
config.fallback_application_name = result.query.fallback_application_name;
}
config.port = result.port;
if(result.protocol == 'socket:') {
config.host = decodeURI(result.pathname);
config.database = result.query.db;
@ -50,7 +51,6 @@ var parse = function(str) {
var auth = (result.auth || ':').split(':');
config.user = auth[0];
config.password = auth[1];
config.port = result.port;
var ssl = result.query.ssl;
if (ssl === 'true' || ssl === '1') {