Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 15 additions & 15 deletions Doc/library/sqlite3.rst
Original file line number Diff line number Diff line change
Expand Up @@ -443,18 +443,19 @@ Module constants
.. code-block:: sql

CREATE TABLE test(
i integer primary key, ! will look up a converter named "integer"
p point, ! will look up a converter named "point"
n number(10) ! will look up a converter named "number"
i integer primary key, -- will look up a converter named "integer"
p point, -- will look up a converter named "point"
n number(10) -- will look up a converter named "number"
)

This flag may be combined with :const:`PARSE_COLNAMES` using the ``|``
(bitwise or) operator.

.. note::

Generated fields (for example ``MAX(p)``) are returned as :class:`str`.
Use :const:`!PARSE_COLNAMES` to enforce types for such queries.
Expressions such as ``MAX(p)`` have no declared type, so their results use
the :ref:`default type conversions <sqlite3-types>`.
Use :const:`!PARSE_COLNAMES` to specify a converter for such expressions.

.. data:: PARSE_COLNAMES

Expand All @@ -467,7 +468,7 @@ Module constants

.. code-block:: sql

SELECT MAX(p) as "p [point]" FROM test; ! will look up converter "point"
SELECT MAX(p) as "p [point]" FROM test; -- will look up converter "point"

This flag may be combined with :const:`PARSE_DECLTYPES` using the ``|``
(bitwise or) operator.
Expand Down Expand Up @@ -846,7 +847,7 @@ Connection objects
* ``finalize()``: Return the final result of the aggregate as
:ref:`a type natively supported by SQLite <sqlite3-types>`.

The number of arguments that the ``step()`` and ``value()`` methods
The number of arguments that the ``step()`` and ``inverse()`` methods
must accept is controlled by *num_params*.

Set to ``None`` to remove an existing SQL aggregate window function.
Expand Down Expand Up @@ -1186,8 +1187,8 @@ Connection objects
``ATTACH DATABASE`` SQL statement.

:param float sleep:
The number of seconds to sleep between successive attempts
to back up remaining pages.
The number of seconds to wait before retrying a backup step
when the database is busy or locked.

Example 1, copy an existing database into another:

Expand Down Expand Up @@ -1407,8 +1408,7 @@ Connection objects
This read-only attribute corresponds to the low-level SQLite
`autocommit mode`_.

``True`` if a transaction is active (there are uncommitted changes),
``False`` otherwise.
``True`` if a transaction is active, ``False`` otherwise.

.. versionadded:: 3.2

Expand Down Expand Up @@ -2172,7 +2172,7 @@ The coordinate pair will be stored as a text string in the database,
using a semicolon to separate the coordinates.
This can be implemented by adding a ``__conform__(self, protocol)``
method which returns the adapted value.
The object passed to *protocol* will be of type :class:`PrepareProtocol`.
The parameter *protocol* will be :class:`PrepareProtocol`.

.. testcode::

Expand Down Expand Up @@ -2443,7 +2443,7 @@ or if :attr:`~Connection.autocommit` is ``True``,
the context manager does nothing.

.. note::
The context manager neither implicitly opens a new transaction
The context manager neither implicitly opens a new transaction on entry
nor closes the connection. If you need a closing context manager, consider
using :meth:`contextlib.closing`.

Expand Down Expand Up @@ -2491,8 +2491,8 @@ Some useful URI tricks include:
OperationalError: attempt to write a readonly database
>>> con.close()

* Do not implicitly create a new database file if it does not already exist;
will raise :exc:`~sqlite3.OperationalError` if unable to create a new file:
* Open an existing database in read/write mode.
If the file does not exist, :func:`connect` raises :exc:`OperationalError`:

.. doctest::

Expand Down
Loading