Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Add context manager support for database connections #96

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
penberg merged 1 commit into tursodatabase:main from AdrianAcala:issue-95
Jul 16, 2025

Conversation

Copy link
Contributor

@AdrianAcala AdrianAcala commented Jun 23, 2025

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

penberg reacted with hooray emoji
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
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
Reviewers
No reviews
Assignees
No one assigned
Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

Automatic commit and rollback when connection used in with block

AltStyle によって変換されたページ (->オリジナル) /