@@ -1620,8 +1620,8 @@ both styles:
1620
1620
1621
1621
.. _sqlite3-adapters :
1622
1622
1623
- Using adapters to store custom Python types in SQLite databases
1624
- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
1623
+ How to adapt custom Python types to SQLite values
1624
+ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
1625
1625
1626
1626
SQLite supports only a limited set of data types natively.
1627
1627
To store custom Python types in SQLite databases, *adapt * them to one of the
@@ -1638,8 +1638,8 @@ registering custom adapter functions.
1638
1638
1639
1639
.. _sqlite3-conform :
1640
1640
1641
- Letting your object adapt itself
1642
- """"""""""""""""""""""""""""""""
1641
+ Let your object adapt itself
1642
+ """"""""""""""""""""""""""""
1643
1643
1644
1644
Suppose we have a :class: `!Point ` class that represents a pair of coordinates,
1645
1645
``x `` and ``y ``, in a Cartesian coordinate system.
@@ -1652,8 +1652,8 @@ The object passed to *protocol* will be of type :class:`PrepareProtocol`.
1652
1652
.. literalinclude :: ../includes/sqlite3/adapter_point_1.py
1653
1653
1654
1654
1655
- Registering an adapter callable
1656
- """""""""""""""""""""""""""""""
1655
+ Register an adapter callable
1656
+ """"""""""""""""""""""""""""
1657
1657
1658
1658
The other possibility is to create a function that converts the Python object
1659
1659
to an SQLite-compatible type.
@@ -1664,8 +1664,8 @@ This function can then be registered using :func:`register_adapter`.
1664
1664
1665
1665
.. _sqlite3-converters :
1666
1666
1667
- Converting SQLite values to custom Python types
1668
- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
1667
+ How to convert SQLite values to custom Python types
1668
+ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
1669
1669
1670
1670
Writing an adapter lets you convert *from * custom Python types *to * SQLite
1671
1671
values.
@@ -1751,8 +1751,8 @@ This section shows recipes for common adapters and converters.
1751
1751
1752
1752
.. _sqlite3-connection-shortcuts :
1753
1753
1754
- Using connection shortcut methods
1755
- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
1754
+ How to use connection shortcut methods
1755
+ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
1756
1756
1757
1757
Using the :meth: `~Connection.execute `,
1758
1758
:meth: `~Connection.executemany `, and :meth: `~Connection.executescript `
@@ -1768,8 +1768,8 @@ directly using only a single call on the :class:`Connection` object.
1768
1768
1769
1769
.. _sqlite3-columns-by-name :
1770
1770
1771
- Accessing columns by name instead of by index
1772
- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
1771
+ Hwo to access columns by name
1772
+ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
1773
1773
1774
1774
One useful feature of the :mod: `!sqlite3 ` module is the built-in
1775
1775
:class: `sqlite3.Row ` class designed to be used as a row factory.
@@ -1782,8 +1782,8 @@ case-insensitively by name:
1782
1782
1783
1783
.. _sqlite3-connection-context-manager :
1784
1784
1785
- Using the connection as a context manager
1786
- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
1785
+ How to use a connection as a context manager
1786
+ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
1787
1787
1788
1788
A :class: `Connection ` object can be used as a context manager that
1789
1789
automatically commits or rolls back open transactions when leaving the body of
@@ -1807,8 +1807,8 @@ the context manager is a no-op.
1807
1807
1808
1808
.. _sqlite3-uri-tricks :
1809
1809
1810
- Working with SQLite URIs
1811
- ^^^^^^^^^^^^^^^^^^^^^^^^
1810
+ How to work with SQLite URIs
1811
+ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
1812
1812
1813
1813
Some useful URI tricks include:
1814
1814
0 commit comments