summary refs log tree commit diff stats
path: root/lib/impure/db_postgres.nim
diff options
context:
space:
mode:
authorMichał Zieliński <michal@zielinscy.org.pl>2013-12-09 23:38:19 +0100
committerMichał Zieliński <michal@zielinscy.org.pl>2013-12-09 23:38:19 +0100
commitb4716e3b5b2cb43bd0a3468e391b4b4619eaabb5 (patch)
tree104913b7849eb702d6883c69442c6e7a8fe74609 /lib/impure/db_postgres.nim
parentd1f3512aba83814146583538c46b7f0c84175423 (diff)
parent14dd3113a255eb59a76b6e1b3346fd9d5122038d (diff)
downloadNim-b4716e3b5b2cb43bd0a3468e391b4b4619eaabb5.tar.gz
Merge branch 'master' of https://github.com/Araq/Nimrod into fix-parameters
Diffstat (limited to 'lib/impure/db_postgres.nim')
-rw-r--r--lib/impure/db_postgres.nim15
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