WAL pragma setting for in-memory databases results in "memory", not "wal"

This commit is contained in:
Dustin Brody 2020-08-24 13:08:35 +02:00
parent e2ccbbb418
commit 9c9b9d5e2e
No known key found for this signature in database
GPG Key ID: 3D7A11A0156519DC
1 changed files with 3 additions and 2 deletions

View File

@ -145,10 +145,11 @@ proc init*(
discard sqlite3_close(env)
return err($sqlite3_errstr(x))
if (let x = sqlite3_column_text(journalModePragma, 0); x != "wal"):
if (let x = sqlite3_column_text(journalModePragma, 0);
x != "memory" and x != "wal"):
discard sqlite3_finalize(journalModePragma)
discard sqlite3_close(env)
return err("Invalid result from pramga")
return err("Invalid result from pragma: " & $x)
# TODO: check current version and implement schema versioning
checkExec "PRAGMA user_version = 1;"