Skip to content

Conversation

@AdrianAcala
Copy link
Contributor

Implements enter and exit methods to enable using Connection objects as context managers. On clean exit, transactions are automatically committed. On exception, transactions are automatically rolled back. This provides sqlite3-compatible behavior and safer transaction handling.

Closes #95

Implements __enter__ and __exit__ methods to enable using Connection objects
as context managers. On clean exit, transactions are automatically committed.
On exception, transactions are automatically rolled back. This provides
sqlite3-compatible behavior and safer transaction handling.

Closes tursodatabase#95
@penberg penberg merged commit 696a23d into tursodatabase:main Jul 16, 2025
6 checks passed
@penberg
Copy link
Contributor

penberg commented Jul 16, 2025

Thanks @AdrianAcala!

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.

Automatic commit and rollback when connection used in with block

2 participants