Skip to content

generic connection string #13

Closed
Closed

Description

@vitaly-t

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.

Activity

  1. carnesen commented on Mar 12, 2019

    @carnesen

    @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.

  2. vitaly-t commented on Mar 12, 2019

    @vitaly-t
    Author

    @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.
  3. hjr3 commented on May 23, 2019

    @hjr3
    Contributor

    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.

  4. vitaly-t commented on May 24, 2019

    @vitaly-t
    Author

    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.

  5. vitaly-t commented on Jul 6, 2019

    @vitaly-t
    Author

    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.

  6. vitaly-t commented on Jul 6, 2019

    @vitaly-t
    Author

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

  7. hjr3 commented on Feb 1, 2020

    @hjr3
    Contributor

    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)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions