Function
zope.rdb.parseDSN

Signature

parseDSN(dsn)

Documentation String

Parses a database connection string.

We could have the following cases:

dbi://dbname dbi://dbname;param1=value... dbi://user/dbname dbi://user:passwd/dbname dbi://user:passwd/dbname;param1=value... dbi://user@host/dbname dbi://user:passwd@host/dbname dbi://user:passwd@host:port/dbname dbi://user:passwd@host:port/dbname;param1=value...

Any values that might contain characters special for URIs need to be quoted as it would be returned by `urllib.quote_plus`.

Return value is a mapping with the following keys:

username username (if given) or an empty string password password (if given) or an empty string host host (if given) or an empty string port port (if given) or an empty string dbname database name parameters a mapping of additional parameters to their values