8000 Docs: alphabetically order sqlite3.Cursor attrs by erlend-aasland · Pull Request #96565 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

Docs: alphabetically order sqlite3.Cursor attrs #96565

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
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
8000
Diff view
Docs: alphabetically order sqlite3.Cursor attrs
  • Loading branch information
erlend-aasland committed Sep 4, 2022
commit 66e57879140cdcbf10844f170f3555288d264746
61 changes: 31 additions & 30 deletions Doc/library/sqlite3.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1468,13 +1468,32 @@ Cursor objects

Required by the DB-API. Does nothing in :mod:`!sqlite3`.

.. attribute:: rowcount
.. attribute:: arraysize

Read-only attribute that provides the number of modified rows for
``INSERT``, ``UPDATE``, ``DELETE``, and ``REPLACE`` statements;
is ``-1`` for other statements,
including :abbr:`CTE (Common Table Expression)` queries.
It is only updated by the :meth:`execute` and :meth:`executemany` methods.
Read/write attribute that controls the number of rows returned by :meth:`fetchmany`.
The default value is 1 which means a single row would be fetched per call.

.. attribute:: connection

Read-only attribute that provides the SQLite database :class:`Connection`
belonging to the cursor. A :class:`Cursor` object created by
calling :meth:`con.cursor() <Connection.cursor>` will have a
:attr:`connection` attribute that refers to *con*:

.. doctest::

>>> con = sqlite3.connect(":memory:")
>>> cur = con.cursor()
>>> cur.connection == con
True

.. attribute:: description

Read-only attribute that provides the column names of the last query. To
remain compatible with the Python DB API, it returns a 7-tuple for each
column where the last six items of each tuple are ``None``.

It is set for ``SELECT`` statements without any matching rows as well.

.. attribute:: lastrowid

Expand All @@ -1491,32 +1510,14 @@ Cursor objects
.. versionchanged:: 3.6
Added support for the ``REPLACE`` statement.

.. attribute:: arraysize

Read/write attribute that controls the number of rows returned by :meth:`fetchmany`.
The default value is 1 which means a single row would be fetched per call.

.. attribute:: description

Read-only attribute that provides the column names of the last query. To
remain compatible with the Python DB API, it returns a 7-t 7C7E uple for each
column where the last six items of each tuple are ``None``.

It is set for ``SELECT`` statements without any matching rows as well.

.. attribute:: connection

Read-only attribute that provides the SQLite database :class:`Connection`
belonging to the cursor. A :class:`Cursor` object created by
calling :meth:`con.cursor() <Connection.cursor>` will have a
:attr:`connection` attribute that refers to *con*:
.. attribute:: rowcount

.. doctest::
Read-only attribute that provides the number of modified rows for
``INSERT``, ``UPDATE``, ``DELETE``, and ``REPLACE`` statements;
is ``-1`` for other statements,
including :abbr:`CTE (Common Table Expression)` queries.
It is only updated by the :meth:`execute` and :meth:`executemany` methods.

>>> con = sqlite3.connect(":memory:")
>>> cur = con.cursor()
>>> cur.connection == con
True

.. The sqlite3.Row example used to be a how-to. It has now been incorporated
into the Row reference. We keep the anchor here in order not to break
Expand Down
0