File tree Expand file tree Collapse file tree 2 files changed +16
-0
lines changed Expand file tree Collapse file tree 2 files changed +16
-0
lines changed Original file line number Diff line number Diff line change @@ -515,6 +515,16 @@ Connection Objects
515
515
516
516
.. XXX what's a db_row-based solution?
517
517
518
+ .. method :: statement_cache()
519
+
520
+ Returns the LRU statement cache for this connection. The statement
521
+ cache is implemented using :meth: `functools.lru_cache `, so it's
522
+ possible to inspect its state by calling :func: `~functools.cache_info `
523
+ or :func: `~functools.cache_parameters ` on the returned object. The
524
+ cache can be cleared by calling :func: `~functools.cache_clear ` on
525
+ the returned object.
526
+
527
+ .. versionadded :: 3.10
518
528
519
529
.. attribute :: text_factory
520
530
Original file line number Diff line number Diff line change @@ -1231,6 +1231,12 @@ Add audit events for :func:`~sqlite3.connect/handle`,
1231
1231
:meth:`~ sqlite3.Connection.load_extension` .
1232
1232
(Contributed by Erlend E. Aasland in :issue:`43762 ` .)
1233
1233
1234
+
1235
+ :mod:`sqlite3` now utilizes :meth:`functools.lru_cache` to implement the
1236
+ connection statement cache. The statement cache can be accessed via the new
1237
+ method :meth:`sqlite3.Connection.statement_cache` .
1238
+ (Contributed by Erlend E. Aasland in :issue:`42862 ` .)
1239
+
1234
1240
sys
1235
1241
-- -
1236
1242
You can’t perform that action at this time.
0 commit comments