@@ -115,7 +115,7 @@ both styles:
115
115
116
116
.. _sqlite3-module-contents :
117
117
118
- Module functions and constants
118
+ Module Functions and Constants
119
119
------------------------------
120
120
121
121
@@ -1241,7 +1241,7 @@ The exception hierarchy is defined by the DB-API 2.0 (:pep:`249`).
1241
1241
1242
1242
.. _sqlite3-types :
1243
1243
1244
- SQLite and Python types
1244
+ SQLite and Python Types
1245
1245
-----------------------
1246
1246
1247
1247
@@ -1291,8 +1291,8 @@ you can let the :mod:`sqlite3` module convert SQLite types to different Python
1291
1291
types via converters.
1292
1292
1293
1293
1294
- Using adapters to store custom Python types in SQLite databases
1295
- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
1294
+ How to Adapt Custom Python Types to SQLite Values
1295
+ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
1296
1296
1297
1297
SQLite supports only a limited set of data types natively.
1298
1298
To store custom Python types in SQLite databases, *adapt * them to one of the
@@ -1309,8 +1309,8 @@ registering custom adapter functions.
1309
1309
1310
1310
.. _sqlite3-conform :
1311
1311
1312
- Letting your object adapt itself
1313
- """"""""""""""""""""""""""""""""
1312
+ Let your object adapt itself
1313
+ """"""""""""""""""""""""""""
1314
1314
1315
1315
Suppose we have a ``Point `` class that represents a pair of coordinates,
1316
1316
``x `` and ``y ``, in a Cartesian coordinate system.
@@ -1323,8 +1323,8 @@ The object passed to *protocol* will be of type :class:`PrepareProtocol`.
1323
1323
.. literalinclude :: ../includes/sqlite3/adapter_point_1.py
1324
1324
1325
1325
1326
- Registering an adapter callable
1327
- """""""""""""""""""""""""""""""
1326
+ Use an adapter callable
1327
+ """""""""""""""""""""""
1328
1328
1329
1329
The other possibility is to create a function that converts the Python object
1330
1330
to an SQLite-compatible type.
@@ -1333,8 +1333,8 @@ This function can then be registered using :func:`register_adapter`.
1333
1333
.. literalinclude :: ../includes/sqlite3/adapter_point_2.py
1334
1334
1335
1335
1336
- Converting SQLite values to custom Python types
1337
- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
1336
+ How to Convert SQLite Values to Custom Python Types
1337
+ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
1338
1338
1339
1339
Writing an adapter lets you convert *from * custom Python types *to * SQLite
1340
1340
values.
@@ -1373,7 +1373,7 @@ The following example illustrates the implicit and explicit approaches:
1373
1373
.. literalinclude :: ../includes/sqlite3/converter_point.py
1374
1374
1375
1375
1376
- Default adapters and converters
1376
+ Default Adapters and Converters
1377
1377
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
1378
1378
1379
1379
There are default adapters for the date and datetime types in the datetime
@@ -1450,8 +1450,8 @@ This section shows recipes for common adapters and converters.
1450
1450
1451
1451
.. _sqlite3-controlling-transactions :
1452
1452
1453
- Controlling Transactions
1454
- ------------------------
1453
+ Transaction Control
1454
+ -------------------
1455
1455
1456
1456
The ``sqlite3 `` module does not adhere to the transaction handling recommended
1457
1457
by :pep: `249 `.
@@ -1493,7 +1493,7 @@ regardless of the value of :attr:`~Connection.isolation_level`.
1493
1493
1494
1494
.. _sqlite3-uri-tricks :
1495
1495
1496
- SQLite URI tricks
1496
+ SQLite URI Tricks
1497
1497
-----------------
1498
1498
1499
1499
Some useful URI tricks include:
@@ -1521,12 +1521,13 @@ can be found in the `SQLite URI documentation`_.
1521
1521
1522
1522
.. _SQLite URI documentation : https://www.sqlite.org/uri.html
1523
1523
1524
- Using :mod: `sqlite3 ` efficiently
1525
- --------------------------------
1526
1524
1525
+ How to Use ``sqlite3 `` Efficiently
1526
+ ----------------------------------
1527
1527
1528
- Using shortcut methods
1529
- ^^^^^^^^^^^^^^^^^^^^^^
1528
+
1529
+ How to Use Shortcut Methods
1530
+ ^^^^^^^^^^^^^^^^^^^^^^^^^^^
1530
1531
1531
1532
Using the nonstandard :meth: `execute `, :meth: `executemany ` and
1532
1533
:meth: `executescript ` methods of the :class: `Connection ` object, your code can
@@ -1539,8 +1540,8 @@ directly using only a single call on the :class:`Connection` object.
1539
1540
.. literalinclude :: ../includes/sqlite3/shortcut_methods.py
1540
1541
1541
1542
1542
- Accessing columns by name instead of by index
1543
- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
1543
+ How to Access Columns by Name
1544
+ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
1544
1545
1545
1546
One useful feature of the :mod: `sqlite3 ` module is the built-in
1546
1547
:class: `sqlite3.Row ` class designed to be used as a row factory.
@@ -1553,8 +1554,8 @@ case-insensitively by name:
1553
1554
1554
1555
.. _sqlite3-connection-context-manager :
1555
1556
1556
- Using the connection as a context manager
1557
- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
1557
+ How to Use a Connection as a Context Manager
1558
+ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
1558
1559
1559
1560
A :class: `Connection ` object can be used as a context manager that
1560
1561
automatically commits or rolls back open transactions when leaving the body of
0 commit comments