service= connection parameter
See original GitHub issueThe native libpq provides a nice way of central maintenance of connections across applications for example in ~/.pg_service.conf
file by using service=
connection parameter. Naturally when I tried to use postgresql://?service=something
connection url it didn’t work. As I believe (after looking into connection-parameters.js
) many other parameters are also ignored.
I am sorry for not providing a patch, but this is because it’s a design decision that you need to make, not just changing code. I’d think that the best one can do here is to pass the connection string to the native libpq unchanged somehow, but that may interfere with your idea of making native/js absolutely interchangeable (I think you’ll agree though that it should drive the js implementation, not hinder native libpq capabilities).
Meanwhile I have patched my copy to handle service parameter — that also takes ignoring ‘host’ if it’s not set. And deleting stuff from defaults on application startup, because it breaks things. I can, of course, give you my patch, but I do not think it’s anywhere near being a good solution, though once you make up your mind about which way to go I’d be glad to help you (especially if I agree with your decision;)).
Issue Analytics
- State:
- Created 10 years ago
- Comments:10 (2 by maintainers)
Top GitHub Comments
+1 to have libpq
service
connection parameter supported.This would be helpful at my place too, where we use the service file interface to make mTLS easier.