Skip to content

Commit feb7cde

Browse files
committed
More dbstatus updates
1 parent ed39378 commit feb7cde

5 files changed

Lines changed: 11 additions & 1 deletion

File tree

apsw/ext.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1115,6 +1115,7 @@ def db_status_get(self) -> dict[str, int]:
11151115
"SQLITE_DBSTATUS_CACHE_WRITE": self.db.status(apsw.SQLITE_DBSTATUS_CACHE_WRITE)[0],
11161116
"SQLITE_DBSTATUS_CACHE_SPILL": self.db.status(apsw.SQLITE_DBSTATUS_CACHE_SPILL)[0],
11171117
"SQLITE_DBSTATUS_DEFERRED_FKS": self.db.status(apsw.SQLITE_DBSTATUS_DEFERRED_FKS)[0],
1118+
"SQLITE_DBSTATUS_TEMPBUF_SPILL": self.db.status(apsw.SQLITE_DBSTATUS_TEMPBUF_SPILL)[0],
11181119
}
11191120

11201121
def __exit__(self, *_) -> None:
@@ -1186,6 +1187,7 @@ def __exit__(self, *_) -> None:
11861187
"SQLITE_DBSTATUS_CACHE_WRITE": "SQLite pager cache writes",
11871188
"SQLITE_DBSTATUS_CACHE_SPILL": "SQLite pager cache writes during transaction",
11881189
"SQLITE_DBSTATUS_DEFERRED_FKS": "SQLite unresolved foreign keys",
1190+
"SQLITE_DBSTATUS_TEMPBUF_SPILL": "SQLite temp spill from full memory to disk",
11891191
"ru_utime": "Time in user mode",
11901192
"ru_stime": "Time in system mode",
11911193
"ru_maxrss": "Maximum resident set size",

doc/changes.rst

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,12 @@ having to go through the intermediate JSON text format.
3232
Added :func:`apsw.ext.Function` for calling SQL functions directly
3333
from Python.
3434

35+
Updated :meth:`Connection.status` to use 64 bit API, and
36+
:func:`apsw.ext.ShowResourceUsage` to show `TEMPBUF_SPILL
37+
<https://sqlite.org/c3ref/c_dbstatus_options.html>`__.
38+
(`cache_size <https://sqlite.org/pragma.html#pragma_cache_size>`__
39+
controls the amount of memory available.)
40+
3541
The `percentile extension <https://sqlite.org/percentile.html>`__ is
3642
enabled when enabling all extensions, which is standard for pypi
3743
downloads.

examples/main.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1384,7 +1384,7 @@ def trace_hook(trace: dict) -> None:
13841384
# block of code does. We use the same query from above.
13851385
#
13861386
# Only statistics that have changed are shown in the summary. There are
1387-
# 20 SQLite values tracked including caching, and 20 system values.
1387+
# 21 SQLite values tracked including caching, and 20 system values.
13881388

13891389
with apsw.ext.ShowResourceUsage(
13901390
sys.stdout, db=connection, scope="thread"

tools/code2rst.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,7 @@ def do_mappings():
117117
"Flags for sqlite3_serialize",
118118
"Win32 Directory Types",
119119
"Prepared Statement Scan Status",
120+
"Datatypes for the CARRAY table-valued funtion with values",
120121
}
121122

122123
for d in sorted(consts.keys()):

tools/genconstants.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
"Conflict resolution modes": "conflict_resolution_modes",
2222
"Constants Defining Special Destructor Behavior": None,
2323
"Database Connection Configuration Options": "db_config",
24+
"Datatypes for the CARRAY table-valued funtion": None,
2425
"Device Characteristics": "device_characteristics",
2526
"Extended Result Codes": "extended_result_codes",
2627
"File Locking Levels": "locking_level",

0 commit comments

Comments
 (0)