summaryrefslogtreecommitdiffstats
path: root/Doc
diff options
context:
space:
mode:
authorAntoine Pitrou <solipsis@pitrou.net>2010-02-02 23:01:36 (GMT)
committerAntoine Pitrou <solipsis@pitrou.net>2010-02-02 23:01:36 (GMT)
commitf37d0a17f8b422ae46350e674cf1d4ad8d9d5175 (patch)
tree2d666ac0c06fc4f2a29d25453137f159756d4c74 /Doc
parent93368182a239f462a001ca5690353ec93512d6ac (diff)
downloadcpython-f37d0a17f8b422ae46350e674cf1d4ad8d9d5175.zip
cpython-f37d0a17f8b422ae46350e674cf1d4ad8d9d5175.tar.gz
cpython-f37d0a17f8b422ae46350e674cf1d4ad8d9d5175.tar.bz2
Merged revisions 77923 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/branches/py3k ........ r77923 | antoine.pitrou | 2010-02-03 00:00:29 +0100 (mer., 03 févr. 2010) | 4 lines Fix sqlite3 docs. `buffer` is gone, `bytes` objects are returned for BLOBs instead. Patch by Pablo Mouzo. ........
Diffstat (limited to 'Doc')
-rw-r--r--Doc/library/sqlite3.rst14
1 files changed, 6 insertions, 8 deletions
diff --git a/Doc/library/sqlite3.rst b/Doc/library/sqlite3.rst
index 74bbb53..696f19c 100644
--- a/Doc/library/sqlite3.rst
+++ b/Doc/library/sqlite3.rst
@@ -187,7 +187,7 @@ Module functions and constants
Registers a callable to convert the custom Python type *type* into one of
SQLite's supported types. The callable *callable* accepts as single parameter
the Python value, and must return a value of the following types: int,
- float, str, bytes (UTF-8 encoded) or buffer.
+ float, str or bytes.
.. function:: complete_statement(sql)
@@ -282,7 +282,7 @@ Connection Objects
as the SQL function.
The function can return any of the types supported by SQLite: bytes, str, int,
- float, buffer and None.
+ float and None.
Example:
@@ -298,7 +298,7 @@ Connection Objects
final result of the aggregate.
The ``finalize`` method can return any of the types supported by SQLite:
- bytes, str, int, float, buffer and None.
+ bytes, str, int, float and None.
Example:
@@ -633,11 +633,9 @@ The following Python types can thus be sent to SQLite without any problem:
+-------------------------------+-------------+
| :class:`float` | ``REAL`` |
+-------------------------------+-------------+
-| :class:`bytes` (UTF8-encoded) | ``TEXT`` |
-+-------------------------------+-------------+
| :class:`str` | ``TEXT`` |
+-------------------------------+-------------+
-| :class:`buffer` | ``BLOB`` |
+| :class:`bytes` | ``BLOB`` |
+-------------------------------+-------------+
@@ -654,7 +652,7 @@ This is how SQLite types are converted to Python types by default:
+-------------+---------------------------------------------+
| ``TEXT`` | depends on text_factory, str by default |
+-------------+---------------------------------------------+
-| ``BLOB`` | buffer |
+| ``BLOB`` | :class:`bytes` |
+-------------+---------------------------------------------+
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
As described before, SQLite supports only a limited set of types natively. To
use other Python types with SQLite, you must **adapt** them to one of the
sqlite3 module's supported types for SQLite: one of NoneType, int, float,
-str, bytes, buffer.
+str, bytes.
The :mod:`sqlite3` module uses Python object adaptation, as described in
:pep:`246` for this. The protocol to use is :class:`PrepareProtocol`.