summary refs log tree commit diff stats
path: root/lib/impure/db_postgres.nim
diff options
context:
space:
mode:
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)