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

Add proxy for autocommit property on Connection #312

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

jonathan-d-zhang
Copy link

Description

Add a proxy property for the autocommit property on sqlite3.Connection objects.

Use Case

I want autocommit=False as suggested by the sqlite3 docs (see docs). I also want to set PRAGMA journal_mode = WAL. The issue is that I can't change the journal_mode when in a transaction, which is always the case when autocommit=False. So the solution is to set the autocommit property after setting the journal_mode. This works fine in sqlite3, but aiosqlite doesn't have the property.

I can work around this by simply reaching into the aiosqlite.Connection object and accessing the _conn attribute, but this is clearly not ideal.

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.

1 participant