summary refs log tree commit diff stats
path: root/lib
diff options
context:
space:
mode:
authorHitesh Jasani <hitesh@grokken.com>2013-12-03 20:13:40 -0500
committerHitesh Jasani <hitesh@grokken.com>2013-12-04 14:01:25 -0500
commit20661c9c46028b9a937bd79ec5b06c96618ddd39 (patch)
tree5350023fd8e9335920a638efeaaf3865f658103c /lib
parent32d2327be025f62bd1b51a98322879cc7e8d218f (diff)
downloadNim-20661c9c46028b9a937bd79ec5b06c96618ddd39.tar.gz
Add docs for connecting to postgres with keyword/value connection
strings.
Diffstat (limited to 'lib')
-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
 
ommitter Andreas Rumpf <rumpf_a@web.de> 2009-05-08 16:36:06 +0200 version 0.7.8' href='/ahoang/Nim/commit/install.txt?h=devel&id=db4f617afcd095db087dcb52e3ea603cca111da7'>db4f617af ^
1f63d1c76 ^
db4f617af ^
8c671d22d ^
1f63d1c76 ^
99bcc233c ^
4d4b3b1c0 ^
db4f617af ^




8c671d22d ^

9387913b7 ^
db4f617af ^




1f63d1c76 ^
053309e60 ^
1f63d1c76 ^
a58a2f382 ^
db4f617af ^








ff4a69b62 ^

db4f617af ^
300430fbb ^
e27e873b7 ^



8c671d22d ^
e27e873b7 ^
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68