diff options
author | Araq <rumpf_a@web.de> | 2013-12-13 15:58:03 +0100 |
---|---|---|
committer | Araq <rumpf_a@web.de> | 2013-12-13 15:58:03 +0100 |
commit | 8c553fa8a2e9476c67c6348bf64c02ea0f19a679 (patch) | |
tree | ce32cf3cd815f4dbb7e5f0f00942f43e1a7871c0 /lib/impure/db_postgres.nim | |
parent | 328f1932925889d5bb7f91c68fb1504b9b26ba8c (diff) | |
parent | 01661daf76daa713d25d06d202f83c842a6f1fe3 (diff) | |
download | Nim-8c553fa8a2e9476c67c6348bf64c02ea0f19a679.tar.gz |
Merge branch 'master' into vm2
Diffstat (limited to 'lib/impure/db_postgres.nim')
-rw-r--r-- | lib/impure/db_postgres.nim | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/lib/impure/db_postgres.nim b/lib/impure/db_postgres.nim index 2dd55e05f..157d58c7c 100644 --- a/lib/impure/db_postgres.nim +++ b/lib/impure/db_postgres.nim @@ -180,6 +180,21 @@ proc Open*(connection, user, password, database: string): TDbConn {. tags: [FDb].} = ## opens a database connection. Raises `EDb` if the connection could not ## be established. + ## + ## Clients can also use Postgres keyword/value connection strings to + ## connect. + ## + ## Example: + ## + ## .. code-block:: nimrod + ## + ## con = Open("", "", "", "host=localhost port=5432 dbname=mydb") + ## + ## See http://www.postgresql.org/docs/current/static/libpq-connect.html#LIBPQ-CONNSTRING + ## for more information. + ## + ## Note that the connection parameter is not used but exists to maintain + ## the nimrod db api. result = PQsetdbLogin(nil, nil, nil, nil, database, user, password) if PQStatus(result) != CONNECTION_OK: dbError(result) # result = nil |