Skip to content

Support resuming transactions / v0.6.0 #23

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

Merged
merged 8 commits into from
Jan 3, 2024
Merged

Conversation

rkistner
Copy link
Contributor

@rkistner rkistner commented Jan 2, 2024

  • Allow catching errors and continuing the transaction. This is technically a breaking change, although it should not be an issue in most cases. Fixes There is no way to catch an error while in a transaction #21.
  • Add tx.closed and db/tx.getAutoCommit() to check whether transactions are active.
  • Requires sqlite3 ^2.3.0 and Dart ^3.2.0.

In some cases, a statement will automatically roll back a transaction, and catching the error won't allow resuming the remainder of the transaction. These errors include SQLITE_FULL, SQLITE_IOERR, SQLITE_NOMEM, SQLITE_BUSY, and SQLITE_INTERRUPT, as well as constraint errors together with ON CONFLICT ROLLBACK, INSERT OR ROLLBACK or similar statements.

Side note: Test fails because of repository URL mismatch between this branch and main. This will be resolved once the PR is merged.

@rkistner rkistner requested a review from DominicGBauer January 3, 2024 11:16
@rkistner rkistner merged commit f994e16 into main Jan 3, 2024
@rkistner rkistner deleted the resume-transactions branch January 3, 2024 11:50
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

Successfully merging this pull request may close these issues.

There is no way to catch an error while in a transaction
2 participants