Hi, I'm new to this language and to it's database bindings.
I've found an issue that seems a bit problematic to what I'm currently developing.
Running a database pragma on db_sqlite's interface results in an error like this:
Traceback (most recent call last)
error_replicate.nim(5) error_replicate
db_sqlite.nim(138) exec
db_sqlite.nim(104) dbError
Error: unhandled exception: unknown error [DbError]
This seems to be a minimal test case to generate this outcome.
import db_sqlite
var db=open("local.db",nil,nil,nil)
db.exec(sql"pragma journal_mode=wal")
db.close()
Executing the same command on a database written to by nim's bindings works properly and allows the program to use WAL instead of the delete-journal(which is very slow).
I suspect that the more primitive sqlite3 module would allow me to execute this properly, but I'd rather not have to resort to that.
Is this actually a bug? Or is the return value that sqlite returns after the query is executed the trigger for the exception?
Anyway, I'm on the git version of the nim compiler and libraries on antergos linux.
I'd really appreciate some pointers in dealing with this, as while it's fairly easy to fix manually, it's a pain when developing my program. Thanks.
If fails because it actually returns the old value and exec doesn't expect any results. Workaround:
discard db.getRow(sql"pragma journal_mode=wal")