voxpelli/node-connect-pg-simple

Support for socket connection string

TheFive opened this issue · 3 comments

I am using a socket connection string for database connection

socket:/home/thefive/tmp/?db=osmbcdev'

Url.parse generates the following:

Params parsed  Url {
  protocol: 'socket:',
  slashes: null,
  auth: null,
  host: '',
  port: null,
  hostname: '',
  hash: null,
  search: '?db=osmbcdev',
  query: 'db=osmbcdev',
  pathname: '/home/thefive/tmp/',
  path: '/home/thefive/tmp/?db=osmbcdev',
  href: 'socket:/home/thefive/tmp/?db=osmbcdev' }

This leads to the following connection object

{ user: undefined,
  password: undefined,
  host: '',
  port: undefined,
  database: 'home' }

Which can not connect to the correct database.

As i am using shared hosting, and am "not allowed" to use postgres on an internal port, but should use sockets, it would be nice, if sockets are still supported.

As a workaround i go back to 3.x and will use the connection object as an alternative.

In current version you can either specify a conObject property or provide a fully configured pgPool, so it should work for you when using either of those, no?

Yes, this should work. As i have put your installed your update in production (my fault in not testing enough) i will use the go back to get system running with connect-pg-simple again (i now use a file session store).
After that i will use the conObject. (or will have a look at the pg pools).
So this is really a minor issue.

5.0.0 supports connection strings again