From fcfea98b1f9c054687a6585280e50ec3cfb486fa Mon Sep 17 00:00:00 2001 From: Marcin Niemira Date: Sun, 8 Jul 2018 14:02:58 +0200 Subject: [PATCH 1/3] [3.7] bpo-34061: Document sqlite3.NotSupportedError (GH-8172). (cherry picked from commit bc9aa813a34474e517af8999565ff6151559d42f) Co-authored-by: Marcin Niemira --- Doc/library/sqlite3.rst | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/Doc/library/sqlite3.rst b/Doc/library/sqlite3.rst index efc74a6bab8ca5..cea4c8360362ec 100644 --- a/Doc/library/sqlite3.rst +++ b/Doc/library/sqlite3.rst @@ -343,7 +343,11 @@ Connection Objects statements under the function name *name*. *num_params* is the number of parameters the function accepts (if *num_params* is -1, the function may take any number of arguments), and *func* is a Python callable that is - called as the SQL function. + called as the SQL function. If *deterministic* is true, the created function + is marked as `deterministic `_, which + allows SQLite to perform additional optimizations. This flag is supported by + SQLite 3.8.3 or higher, :exc:`NotSupportedError` will be raised if used + with older versions. The function can return any of the types supported by SQLite: bytes, str, int, float and ``None``. @@ -828,6 +832,13 @@ Exceptions disconnect occurs, the data source name is not found, a transaction could not be processed, etc. It is a subclass of :exc:`DatabaseError`. +.. exception:: NotSupportedError + + Exception raised in case a method or database API was used which is not + supported by the database, e.g. calling the :meth:`~Connection.rollback` + method on a connection that does not support transaction or has + transactions turned off. It is a subclass of :exc:`DatabaseError`. + .. _sqlite3-types: From 74f614c1a51f6468d574d6f3c5b0660ac568fa31 Mon Sep 17 00:00:00 2001 From: n0npax Date: Sun, 8 Jul 2018 14:42:58 +0200 Subject: [PATCH 2/3] [3.7] bpo-34061: Document sqlite3.NotSupportedError (GH-8172). (cherry picked from commit bc9aa813a34474e517af8999565ff6151559d42f) Co-authored-by: Marcin Niemira From 938ae7d9b57105ea821b2d7ef23ea51cd3cffd40 Mon Sep 17 00:00:00 2001 From: Berker Peksag Date: Sun, 8 Jul 2018 15:53:30 +0300 Subject: [PATCH 3/3] fix merge glitch --- Doc/library/sqlite3.rst | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/Doc/library/sqlite3.rst b/Doc/library/sqlite3.rst index cea4c8360362ec..9f9c57c0f3b3dc 100644 --- a/Doc/library/sqlite3.rst +++ b/Doc/library/sqlite3.rst @@ -343,11 +343,7 @@ Connection Objects statements under the function name *name*. *num_params* is the number of parameters the function accepts (if *num_params* is -1, the function may take any number of arguments), and *func* is a Python callable that is - called as the SQL function. If *deterministic* is true, the created function - is marked as `deterministic `_, which - allows SQLite to perform additional optimizations. This flag is supported by - SQLite 3.8.3 or higher, :exc:`NotSupportedError` will be raised if used - with older versions. + called as the SQL function. The function can return any of the types supported by SQLite: bytes, str, int, float and ``None``.