Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

generic connection string #13

Closed
vitaly-t opened this issue Jul 13, 2017 · 7 comments
Closed

generic connection string #13

vitaly-t opened this issue Jul 13, 2017 · 7 comments

Comments

@vitaly-t
Copy link

vitaly-t commented Jul 13, 2017

I have implemented a generic-version connection-string, which can be used by this library as a special case for PostgreSQL:

  • It would support only the first segment as property database.
  • It would support only special values for the protocol, such as postgres + socket

The rest I think would be directly reusable.

@carnesen
Copy link

@vitaly-t The widely-used package pg relies on this one, pg-connection-string. I think it would unwise for the author of this package to update the code to use connection-string, however robust that library may be, because presumably pg users are depending on the specific behavior of the parsing logic here. I suggest closing your issue.

@vitaly-t
Copy link
Author

vitaly-t commented Mar 12, 2019

@carnesen There are some open issues related to the use of the connection, so there is some wisdom in making the change:

  • PostgreSQL supports multi-connection strings since version 10, but the driver still doesn't support it, see Support for multiple hosts brianc/node-postgres#1470
  • Generic connection string is backward compatible, so it is relatively safe, though a major version bump would be required anyway, which is ok.

@hjr3
Copy link
Contributor

hjr3 commented May 23, 2019

Lots of packages depdend on this specific package. Updating the internsl to use connection-string would require a major version bump.

Also, node-postgres still depends on v0.1.3 of this library.

@vitaly-t
Copy link
Author

vitaly-t commented May 24, 2019

Lots of packages depdend on this specific package. Updating the internsl to use connection-string would require a major version bump.

connection-string is compatible in the way strings are defined. Only the clients that do not follow URL Connection String spec would need an update. But a major version bump would be required, agreed.

Also, node-postgres still depends on v0.1.3 of this library.

In the meantime, everyone is required to include the library independently. Also, if you bump the major version, there will be no conflict.

@vitaly-t
Copy link
Author

vitaly-t commented Jul 6, 2019

I would be willing to do a PR for this, if there is any interest.

The change would require to leave behind certain proprietary things that do not comply with the URL Connection String Spec.

For example, for unix sockets, use proper .socket in the host name, and not socket://.

Example:

postgres://some-unix.address.socket/dbname

or, if the address requires use of /, then via a URL parameter:

postgres://?socket=first%2Fsecond%2Fthird.socket

This is necessary, and not just for the sake of a standard, but also to make progress toward supporting multiple hosts, in which you can have a combination of a regular host and a unix socket.

@vitaly-t
Copy link
Author

vitaly-t commented Jul 6, 2019

Biting the bullet on this one, here's the PR that implements it.

@hjr3
Copy link
Contributor

hjr3 commented Feb 1, 2020

For the lack of the progress either way, to move toward a better generic approach, I no longer want to advocate any kind of integration. For people who want to use connection-string, they can just do so independently, and generate a connection object from it to be passed into the driver, as shown within the Adapters.

#32 (comment)

@hjr3 hjr3 closed this as completed Feb 1, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants