This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
serialization is the same sequence of bytes which would be written to
disk if that database were backed up to disk.
*name* is the database to be serialized, and defaults to the main
database.
:param str name:
The database name to be serialized.
Defaults to ``"main"``.
:rtype: bytes
.. note::
Expand All
@@ -969,12 +967,24 @@ Connection objects
:class:`Connection`.
This method causes the database connection to disconnect from database
*name*, and reopen *name* as an in-memory database based on the
serialization contained in *data*. Deserialization will raise
:exc:`OperationalError` if the database connection is currently involved
in a read transaction or a backup operation. :exc:`OverflowError` will be
raised if ``len(data)`` is larger than ``2**63 - 1``, and
:exc:`DatabaseError` will be raised if *data* does not contain a valid
SQLite database.
serialization contained in *data*.
:param bytes data:
A serialized database.
:param str name:
The database name to deserialize into.
Defaults to ``"main"``.
:raises OperationalError:
If the database connection is currently involved in a read
transaction or a backup operation.
:raises DatabaseError:
If *data* does not contain a valid SQLite database.
:raises OverflowError:
If :func:`len(data) <len>` is larger than ``2**63 - 1``.
.. note::
Expand Down
Expand Up
@@ -1071,13 +1081,13 @@ Cursor objects
.. method:: fetchone()
Fetch the next row of a query result set as a :class:`tuple`.
Return the next row of a query result set as a :class:`tuple`.
Return ``None`` if no more data is available.
.. method:: fetchmany(size=cursor.arraysize)
Fetch the next set of rows of a query result as a :class:`list`.
Return the next set of rows of a query result as a :class:`list`.
Return an empty list if no more rows are available.
The number of rows to fetch per call is specified by the *size* parameter.
Expand All
@@ -1093,7 +1103,7 @@ Cursor objects
.. method:: fetchall()
Fetch all (remaining) rows of a query result as a :class:`list`.
Return all (remaining) rows of a query result as a :class:`list`.
Return an empty list if no rows are available.
Note that the :attr:`arraysize` attribute can affect the performance of
this operation.
Expand Down
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
[3.11] gh-95273: Improve documented return values and exceptions raised for sqlite3 class methods (GH-95530) #95673
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
Uh oh!
There was an error while loading. Please reload this page.
[3.11] gh-95273: Improve documented return values and exceptions raised for sqlite3 class methods (GH-95530) #95673
Filter by extension
Viewed files
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
There are no files selected for viewing