From f882499ca2e016b00e144c94a25ebf5b5a2839be Mon Sep 17 00:00:00 2001 From: Zahary Karadjov Date: Mon, 9 Dec 2013 00:26:04 +0200 Subject: [PATCH] Merge branch 'master' of github.com:Araq/Nimrod into upstream --- src/db_postgres.nim | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/db_postgres.nim b/src/db_postgres.nim index 2dd55e05f3..157d58c7cf 100644 --- a/src/db_postgres.nim +++ b/src/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