sincecutoff.com
← all changes

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> .diskused
SELECT 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

Check the installed version and the source before using it. Entry JSON

Report a problem with this card