Skip to content

Commit e36c744

Browse files
Marcin Niemiran0npax
authored andcommitted
[3.6] bpo-34061: Document sqlite3.NotSupportedError (pythonGH-8172).
(cherry picked from commit bc9aa81) Co-authored-by: Marcin Niemira <[email protected]>
1 parent b7874c8 commit e36c744

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

Doc/library/sqlite3.rst

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -336,7 +336,11 @@ Connection Objects
336336
statements under the function name *name*. *num_params* is the number of
337337
parameters the function accepts (if *num_params* is -1, the function may
338338
take any number of arguments), and *func* is a Python callable that is
339-
called as the SQL function.
339+
called as the SQL function. If *deterministic* is true, the created function
340+
is marked as `deterministic <https://sqlite.org/deterministic.html>`_, which
341+
allows SQLite to perform additional optimizations. This flag is supported by
342+
SQLite 3.8.3 or higher, :exc:`NotSupportedError` will be raised if used
343+
with older versions.
340344

341345
The function can return any of the types supported by SQLite: bytes, str, int,
342346
float and ``None``.
@@ -771,6 +775,13 @@ Exceptions
771775
disconnect occurs, the data source name is not found, a transaction could
772776
not be processed, etc. It is a subclass of :exc:`DatabaseError`.
773777

778+
.. exception:: NotSupportedError
779+
780+
Exception raised in case a method or database API was used which is not
781+
supported by the database, e.g. calling the :meth:`~Connection.rollback`
782+
method on a connection that does not support transaction or has
783+
transactions turned off. It is a subclass of :exc:`DatabaseError`.
784+
774785

775786
.. _sqlite3-types:
776787

0 commit comments

Comments
 (0)