summary refs log tree commit diff stats
path: root/lib/impure/db_postgres.nim
diff options
context:
space:
mode:
authorAraq <rumpf_a@web.de>2018-08-16 12:30:00 +0200
committerAraq <rumpf_a@web.de>2018-08-16 12:30:00 +0200
commit2870ca5d717996d8451282de56c20418c89162a9 (patch)
treeb9b866ac48680a8363bf3d30e9664b59c66e2a53 /lib/impure/db_postgres.nim
parente05d0ea0bbb6ea48fb5017deec28f558e7e15755 (diff)
parentd82dd3c47d4aaaaea4bd1c1063d34006073bca38 (diff)
downloadNim-2870ca5d717996d8451282de56c20418c89162a9.tar.gz
Merge branch 'araq-misc' into devel
Diffstat (limited to 'lib/impure/db_postgres.nim')
-rw-r--r--lib/impure/db_postgres.nim7
1 files changed, 2 insertions, 5 deletions
diff --git a/lib/impure/db_postgres.nim b/lib/impure/db_postgres.nim
index 1459f0d7e..e765cc197 100644
--- a/lib/impure/db_postgres.nim
+++ b/lib/impure/db_postgres.nim
@@ -103,10 +103,7 @@ proc dbFormat(formatstr: SqlQuery, args: varargs[string]): string =
   else:
     for c in items(string(formatstr)):
       if c == '?':
-        if args[a] == nil:
-          add(result, "NULL")
-        else:
-          add(result, dbQuote(args[a]))
+        add(result, dbQuote(args[a]))
         inc(a)
       else:
         add(result, c)
@@ -179,7 +176,7 @@ proc setRow(res: PPGresult, r: var Row, line, cols: int32) =
     setLen(r[col], 0)
     let x = pqgetvalue(res, line, col)
     if x.isNil:
-      r[col] = nil
+      r[col] = ""
     else:
       add(r[col], x)