Skip to content

Commit c74b6d9

Browse files
committed
Setting authorizer now invalidates all statements
SQLite 3.52.0 update
1 parent 1cd1f8e commit c74b6d9

2 files changed

Lines changed: 7 additions & 6 deletions

File tree

doc/execution.rst

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -111,9 +111,7 @@ you run in order then the cache will not help.
111111

112112
If you are using :attr:`authorizers <Connection.authorizer>` then be
113113
aware authorizer callback is only called while statements are being
114-
prepared. You can :class:`specify zero <Connection>` which will
115-
disable the statement cache completely, use use `can_cache = False`
116-
flag to `execute`/`executemany`.
114+
prepared.
117115

118116
.. _tracing:
119117

src/connection.c

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6105,8 +6105,7 @@ Connection_set_row_trace_attr(PyObject *self_, PyObject *value, void *Py_UNUSED(
61056105
particular action is ok to be part of the statement.
61066106
61076107
Typical usage would be if you are running user supplied SQL and want
6108-
to prevent harmful operations. You should also
6109-
set the :class:`statementcachesize <Connection>` to zero.
6108+
to prevent harmful operations.
61106109
61116110
The authorizer callback has 5 parameters:
61126111
@@ -6121,10 +6120,14 @@ Connection_set_row_trace_attr(PyObject *self_, PyObject *value, void *Py_UNUSED(
61216120
(*SQLITE_DENY* is returned if there is an error in your
61226121
Python code).
61236122
6123+
Changing the authorizer (including setting to :code:`None`) will not
6124+
affect currently executing statements. Any cached statements
6125+
or currently executing ones will be prepared again on their
6126+
next use.
6127+
61246128
.. seealso::
61256129
61266130
* :ref:`Example <example_authorizer>`
6127-
* :ref:`statementcache`
61286131
61296132
-* sqlite3_set_authorizer
61306133
*/

0 commit comments

Comments
 (0)