#string-parser #scheme #postgresql #uri #connection #password #host-port

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

#761 in Database interfaces

Download history 231/week @ 2024-10-07 52/week @ 2024-10-14

283 downloads per month

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
~70K SLoC