Skip to content

Commit 5abaa38

Browse files
gh-118469: Document sqlite3.Binary in module constants
Add documentation for sqlite3.Binary, which is an alias for memoryview used for handling BLOB (Binary Large Object) data according to the DB-API 2.0 specification. The documentation explains: - Binary is an alias for memoryview - It's used for SQL BLOB values per DB-API 2.0 spec - Binary data can also be handled directly with bytes objects - Includes proper cross-references to related types Fixes gh-118469
1 parent 180b3eb commit 5abaa38

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

Doc/library/sqlite3.rst

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -498,6 +498,20 @@ Module constants
498498

499499
The ``named`` DB-API parameter style is also supported.
500500

501+
.. data:: Binary
502+
503+
A type object used to describe columns containing :abbr:`BLOB (Binary Large OBject)` data.
504+
Implemented as an alias for :class:`memoryview`.
505+
506+
According to the DB-API 2.0 specification, :data:`!Binary` is used for SQL
507+
``BLOB`` (Binary Large Object) values. In :mod:`!sqlite3`, this is an alias
508+
for the built-in :class:`memoryview` type.
509+
510+
.. note::
511+
512+
Binary data can also be stored and retrieved using :class:`bytes` objects
513+
directly without using :data:`!Binary`.
514+
501515
.. data:: sqlite_version
502516

503517
Version number of the runtime SQLite library as a :class:`string <str>`.

0 commit comments

Comments
 (0)