sqlite3 CLI `.diskused` command and optional `diskused()` extension
Introduced 2026-10-09 · score 0.90
HOW TO USE IT
When you need to inspect space used by a SQLite database’s tables and indexes, run `.diskused` in the CLI or call `diskused('main')` in SQL.
sqlite3 <database-file> .diskusedSELECT diskused('main');WHY THIS HELPS
Inspect database space usage from the sqlite3 CLI or use the SQL extension in a database workflow.
BEFORE THIS CHANGE
Use the separate `sqlite3_analyzer` utility; SQLite 3.54.0 deprecated it and identifies `.diskused` as its replacement.
REQUIREMENTS AND LIMITATIONS
- Version: 3.54.0
- <database-file> (required): SQLite database file to analyze.
- diskused(X) (required): X is the schema containing the database, usually `'main'`.
- Prerequisite: The `diskused()` function is built into the SQLite CLI.
- Prerequisite: For third-party applications, compile `ext/misc/diskused.c` separately and load it using `sqlite3_load_extension()`; SQLite must be compiled with `-DSQLITE_ENABLE_DBSTAT_VTAB`.
- Prerequisite: `.diskused` is available as of SQLite 3.54.0.
- `diskused()` is an optional extension.
- `sqlite3_analyzer` is deprecated.
FIRST-PARTY EVIDENCE
- https://sqlite.org/changes.html#version_3_54_0
- https://www2.sqlite.org/diskusedfunc.html
- https://www.sqlite.org/cli.html
Check the installed version and the source before using it. Entry JSON