Skip to content

Commit f06917e

Browse files
committed
Fix sqlite3 docs. buffer is gone, bytes objects are returned for BLOBs instead.
Patch by Pablo Mouzo.
1 parent 05b7c56 commit f06917e

File tree

1 file changed

+6
-8
lines changed

1 file changed

+6
-8
lines changed

Doc/library/sqlite3.rst

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@ Module functions and constants
187187
Registers a callable to convert the custom Python type *type* into one of
188188
SQLite's supported types. The callable *callable* accepts as single parameter
189189
the Python value, and must return a value of the following types: int,
190-
float, str, bytes (UTF-8 encoded) or buffer.
190+
float, str or bytes.
191191

192192

193193
.. function:: complete_statement(sql)
@@ -282,7 +282,7 @@ Connection Objects
282282
as the SQL function.
283283

284284
The function can return any of the types supported by SQLite: bytes, str, int,
285-
float, buffer and None.
285+
float and None.
286286

287287
Example:
288288

@@ -298,7 +298,7 @@ Connection Objects
298298
final result of the aggregate.
299299

300300
The ``finalize`` method can return any of the types supported by SQLite:
301-
bytes, str, int, float, buffer and None.
301+
bytes, str, int, float and None.
302302

303303
Example:
304304

@@ -633,11 +633,9 @@ The following Python types can thus be sent to SQLite without any problem:
633633
+-------------------------------+-------------+
634634
| :class:`float` | ``REAL`` |
635635
+-------------------------------+-------------+
636-
| :class:`bytes` (UTF8-encoded) | ``TEXT`` |
637-
+-------------------------------+-------------+
638636
| :class:`str` | ``TEXT`` |
639637
+-------------------------------+-------------+
640-
| :class:`buffer` | ``BLOB`` |
638+
| :class:`bytes` | ``BLOB`` |
641639
+-------------------------------+-------------+
642640

643641

@@ -654,7 +652,7 @@ This is how SQLite types are converted to Python types by default:
654652
+-------------+---------------------------------------------+
655653
| ``TEXT`` | depends on text_factory, str by default |
656654
+-------------+---------------------------------------------+
657-
| ``BLOB`` | buffer |
655+
| ``BLOB`` | :class:`bytes` |
658656
+-------------+---------------------------------------------+
659657

660658
The type system of the :mod:`sqlite3` module is extensible in two ways: you can
@@ -669,7 +667,7 @@ Using adapters to store additional Python types in SQLite databases
669667
As described before, SQLite supports only a limited set of types natively. To
670668
use other Python types with SQLite, you must **adapt** them to one of the
671669
sqlite3 module's supported types for SQLite: one of NoneType, int, float,
672-
str, bytes, buffer.
670+
str, bytes.
673671

674672
The :mod:`sqlite3` module uses Python object adaptation, as described in
675673
:pep:`246` for this. The protocol to use is :class:`PrepareProtocol`.

0 commit comments

Comments
 (0)