Skip to content

Commit 687ab7d

Browse files
committed
use global pragma for prepared stmts
Signed-off-by: George Lemon <georgelemon@protonmail.com>
1 parent 3b2ef5a commit 687ab7d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/ozark/query.nim

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -556,7 +556,7 @@ macro rawSQL*(models: ptr ModelsTable, sql: static string, values: varargs[untyp
556556
raise newException(OzarkModelDefect, "SQL Parsing Error: " & e.msg)
557557

558558
type PreparedKey = tuple[conn: pointer, name: string]
559-
var preparedRtCache {.threadvar.}: Table[PreparedKey, SqlPrepared]
559+
var preparedRtCache {.global.}: TableRef[PreparedKey, SqlPrepared] = newTable[PreparedKey, SqlPrepared]()
560560

561561
proc ensurePrepared*(db: DbConn, name: string, sql: SqlQuery, nParams: int): SqlPrepared =
562562
let key: PreparedKey = (cast[pointer](db), name)

0 commit comments

Comments
 (0)