#string-parser #postgresql #connection #uri #forked #host-port #url-scheme

bin+lib postgres-conn-str

PostgreSQL-compatibly idiosyncratic connection string parsing. Forked from pg-connection-string

2 releases

0.1.1 Oct 11, 2024
0.1.0 Oct 11, 2024

#900 in Database interfaces

Download history 165/week @ 2024-10-05 112/week @ 2024-10-12 6/week @ 2024-10-19 1/week @ 2024-11-02

284 downloads per month
Used in hashpoo

AGPL-3.0-or-later

69KB
2K SLoC

pg-connection-string parses URIs in the ways that psql (and generally, libpq) will accept them. This is a more convenient and robust alternative to crates like uri.

As outlined in the Postgres docs, the general form for a connection URI is:

postgresql://[userspec@][hostspec][/dbname][?paramspec]

where userspec is:

user[:password]

and hostspec is:

[host][:port][,...]

and paramspec is:

name=value[&...]

The URI scheme designator can be either postgresql:// or postgres://. Each of the remaining URI parts is optional.

Dependencies

~1.2–8.5MB
~69K SLoC