summary refs log tree commit diff stats
path: root/lib/impure/db_sqlite.nim
diff options
context:
space:
mode:
authorSimon Hafner <hafnersimon@gmail.com>2015-05-08 06:40:34 +0500
committerSimon Hafner <hafnersimon@gmail.com>2015-05-08 06:40:34 +0500
commitf5cca89610905f35b50259cfe81e6d1d4153d39c (patch)
tree3c49f45590875e4eab78ae976d6ac254030e62af /lib/impure/db_sqlite.nim
parent2474c1bb111b38ddef64659c893722b357a27384 (diff)
parentc384f05e49e0716cc99042491f65bcc7d415d4c3 (diff)
downloadNim-f5cca89610905f35b50259cfe81e6d1d4153d39c.tar.gz
merged devel into epc
Diffstat (limited to 'lib/impure/db_sqlite.nim')
-rw-r--r--lib/impure/db_sqlite.nim2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/impure/db_sqlite.nim b/lib/impure/db_sqlite.nim
index 4be692f39..8536ab6f2 100644
--- a/lib/impure/db_sqlite.nim
+++ b/lib/impure/db_sqlite.nim
@@ -205,7 +205,7 @@ proc setEncoding*(connection: TDbConn, encoding: string): bool {.
   exec(connection, sql"PRAGMA encoding = ?", [encoding])
   result = connection.getValue(sql"PRAGMA encoding") == encoding
 
-when isMainModule:
+when not defined(testing) and isMainModule:
   var db = open("db.sql", "", "", "")
   exec(db, sql"create table tbl1(one varchar(10), two smallint)", [])
   exec(db, sql"insert into tbl1 values('hello!',10)", [])