Skip to content

gh-128505: Expose an interface to sqlite3_file_control#148870

Open
qris wants to merge 20 commits intopython:mainfrom
qris:sqlite3_file_control
Open

gh-128505: Expose an interface to sqlite3_file_control#148870
qris wants to merge 20 commits intopython:mainfrom
qris:sqlite3_file_control

Conversation

@qris
Copy link
Copy Markdown

@qris qris commented Apr 22, 2026

sqlite3_file_control can affect the semantics of a sqlite3 database, but is not exposed by the sqlite.Connection class. In particular, this addition allows callers to use the SQLITE_FCNTL_PERSIST_WAL opcode. SQLITE_FCNTL_PERSIST_WAL ensures that callers can open a WAL-mode database on a read-only mount even when the writers have closed the DB.

This is @hashbrowncipher's work from #128507, merged with cpython master and conflicts resolved in the hope of making progress in getting it merged.

hashbrowncipher and others added 16 commits January 4, 2025 17:55
Add a private API for raising DB-API compatible exceptions based on the
result code of SQLite C APIs. Some APIs do not store the error indicator
on the database pointer, so we need to be able to deduce the DB-API
compatible exception directly from the error code.

- rename _pysqlite_seterror() as set_error_from_db()
- introduce set_error_from_code()
Pull in changes including upstream merge of set_error_from_db.
@python-cla-bot
Copy link
Copy Markdown

python-cla-bot Bot commented Apr 22, 2026

The following commit authors need to sign the Contributor License Agreement:

CLA not signed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants