You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
node-postgres allows to connect using sockets in a connection string like this: pg.connect('/some/path', callback)
That is nice, but does not allows to set another database but one with the same user name.
I propose to accept a special protocol named socket to enable the database selection like this: pg.connect('socket:/some/path?database', callback)
The url.parse('socket:/some/path?database') returns:
That data is enough to make the magic, with a small change on function parse at connection-parameters.js. (and also my favorite solution)
That can not change the current behavior for sockets when the first char is "/".
I also try a change on current sockets behavior, splitting the string on spaces. That makes easy to set a database by this way: pg.connect('/some/path database', callback)
node-postgres
allows to connect using sockets in a connection string like this:pg.connect('/some/path', callback)
That is nice, but does not allows to set another database but one with the same user name.
I propose to accept a special protocol named
socket
to enable the database selection like this:pg.connect('socket:/some/path?database', callback)
The
url.parse('socket:/some/path?database')
returns:That data is enough to make the magic, with a small change on function
parse
atconnection-parameters.js
. (and also my favorite solution)That can not change the current behavior for sockets when the first char is "/".
I also try a change on current sockets behavior, splitting the string on spaces. That makes easy to set a database by this way:
pg.connect('/some/path database', callback)
What you think?
node-postgres
can use the solution 1, 2, or a mix of both?I can also code it, if you like.
The text was updated successfully, but these errors were encountered: