Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sqlite: tryQuery doesn't save you from errors #45

Open
alaviss opened this issue Feb 27, 2020 · 0 comments
Open

sqlite: tryQuery doesn't save you from errors #45

alaviss opened this issue Feb 27, 2020 · 0 comments

Comments

@alaviss
Copy link
Contributor

alaviss commented Feb 27, 2020

This is the code used for tryQuery:

if stepQuery(db, prepStmt, returnsData):
  action
stopQuery(db, prepStmt)

Which appears to be designed to not throw any errors on failure, but:

template stopQuery*(db: DbConn; s: PStmt) =
  if sqlite3.reset(s) != SQLITE_OK: dbError(db)

Which will throw the last error occurred from executing the statement, see sqlite3_reset() documentation

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant