dsn 0.1.2

DSN (Data Source Name) parser
Documentation

DSN (Data Source Name) parser

crates.io Build Status

DSN format:

<driver>://<username>:<password>@<protocol>(<address>)/<database>?param1=value1&...&paramN=valueN

A DSN in its fullest form:

driver://username:password@protocol(address)/dbname?param=value

For protocol TCP/UDP address have the form host:port.

For protocol unix (Unix domain sockets) the address is the absolute path to the socket.

Connect to database on a non standard port:

pgsql://user:pass@tcp(localhost:5555)/dbname

When using a Unix domain socket:

mysql://user@unix(/path/to/socket)/database