8000 gh-128505: Expose an interface to sqlite3_file_control by hashbrowncipher · Pull Request #128507 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

gh-128505: Expose an interface to sqlite3_file_control #128507

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

Open
wants to merge 15 commits into
base: main
Choose a base branch
from
Open
Prev Previous commit
Next Next commit
add reference docs
  • Loading branch information
hashbrowncipher committed Jan 7, 2025
commit 773dc5f5e9aa4b2581e0640a7b42ce1437205921
73 changes: 73 additions & 0 deletions Doc/library/sqlite3.rst
8000
Original file line number Diff line number Diff line change
Expand Up @@ -579,6 +579,61 @@ Module constants
.. deprecated-removed:: 3.12 3.14
The :data:`!version` and :data:`!version_info` constants.

.. _sqlite3-fcntl-constants:

.. data:: SQLITE_FCNTL_LOCKSTATE
SQLITE_FCNTL_GET_LOCKPROXYFILE
SQLITE_FCNTL_SET_LOCKPROXYFILE
SQLITE_FCNTL_LAST_ERRNO
SQLITE_FCNTL_SIZE_HINT
SQLITE_FCNTL_CHUNK_SIZE
SQLITE_FCNTL_FILE_POINTER
SQLITE_FCNTL_SYNC_OMITTED
SQLITE_FCNTL_WIN32_AV_RETRY
SQLITE_FCNTL_PERSIST_WAL
SQLITE_FCNTL_OVERWRITE
SQLITE_FCNTL_POWERSAFE_OVERWRITE
SQLITE_FCNTL_PRAGMA
SQLITE_FCNTL_BUSYHANDLER
SQLITE_FCNTL_MMAP_SIZE
SQLITE_FCNTL_TRACE
SQLITE_FCNTL_HAS_MOVED
SQLITE_FCNTL_SYNC
SQLITE_FCNTL_COMMIT_PHASETWO
SQLITE_FCNTL_WIN32_SET_HANDLE
SQLITE_FCNTL_WAL_BLOCK
SQLITE_FCNTL_ZIPVFS
SQLITE_FCNTL_RBU
SQLITE_FCNTL_VFS_POINTER
SQLITE_FCNTL_JOURNAL_POINTER
SQLITE_FCNTL_WIN32_GET_HANDLE
SQLITE_FCNTL_PDB
SQLITE_FCNTL_BEGIN_ATOMIC_WRITE
SQLITE_FCNTL_COMMIT_ATOMIC_WRITE
SQLITE_FCNTL_ROLLBACK_ATOMIC_WRITE
SQLITE_FCNTL_LOCK_TIMEOUT
SQLITE_FCNTL_DATA_VERSION
SQLITE_FCNTL_SIZE_LIMIT
SQLITE_FCNTL_CKPT_DONE
SQLITE_FCNTL_RESERVE_BYTES
SQLITE_FCNTL_CKPT_START
SQLITE_FCNTL_EXTERNAL_READER
SQLITE_FCNTL_CKSM_FILE
SQLITE_FCNTL_RESET_CACHE
SQLITE_FCNTL_NULL_IO

These constants are used for the :meth:`Connection.file_control` method.

The availability of these constants varies depending on the version of SQLite
Python was compiled with.

.. versionadded:: 3.14

.. seealso::

https://www.sqlite.org/c3ref/c_fcntl_begin_atomic_write.html
SQLite docs: Standard File Control Opcodes

.. _sqlite3-connection-objects:

Connection objects
Expand Down Expand Up @@ -1288,6 +1343,24 @@ Connection objects

.. versionadded:: 3.12

.. method:: file_control(op, val, /, name="main")

Invoke a file control method on the database.
Opcodes which take non-integer arguments are not supported.

:param int op:
The :ref:`SQLITE_FCNTL_* constant <sqlite3-fcntl-constants>` to invoke.

:param int arg:
The argument to pass to the operation.

:param str name:
the database name to operate against.

:rtype: int

.. versionadded:: 3.14

.. method:: serialize(*, name="main")

Serialize a database into a :class:`bytes` object. For an
Expand Down
Loading
0