{
  "slug": "sqlite3-cli-diskused-command-and-optional-diskused-extension-5af5af6cdfe2",
  "title": "sqlite3 CLI `.diskused` command and optional `diskused()` extension",
  "tools": [
    "sqlite3"
  ],
  "tags": [
    "agent"
  ],
  "introduced_at": "2026-10-09T00:00:00.000Z",
  "announced_at": "2026-10-09T00:00:00.000Z",
  "effective_at": null,
  "date_basis": "source-publication",
  "status": "unknown",
  "how": {
    "incantation": "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.",
    "examples": [
      "sqlite3 <database-file> .diskused",
      "SELECT diskused('main');"
    ],
    "gotchas": [
      "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."
    ]
  },
  "why_it_matters": "Inspect database space usage from the sqlite3 CLI or use the SQL extension in a database workflow.",
  "before": "Use the separate `sqlite3_analyzer` utility; SQLite 3.54.0 deprecated it and identifies `.diskused` as its replacement.",
  "sources": [
    "https://sqlite.org/changes.html#version_3_54_0",
    "https://www2.sqlite.org/diskusedfunc.html",
    "https://www.sqlite.org/cli.html"
  ],
  "rank": 0.90019,
  "judge": {
    "publish": true,
    "judge_model": "codex-cli/gpt-6-luna+typesafe/jev-1.13.0",
    "prompt_version": "extract-v7+enrich-v2+judge-v2x3+jev-publish-v1"
  },
  "review_state": "approved",
  "provenance": {
    "run_id": "wave2b-20261017",
    "verdict_id": "wave2b-20261017:wave2b-20261017-aa6aa8a7b4aa7d39-4:gate",
    "evidence_hash": "1fb71d915964f35cc634b16363eed077d8e1b30e6badf26cf9b3e5eb52e979c1"
  },
  "review": {
    "draft_hash": "e604761718a769affe28139df92fa75f3071f4af2e4b03edd564a41180612b00",
    "reviewer": "publication-gate",
    "reviewed_at": "2026-10-09T00:00:00.000Z",
    "decision": "wave2b-20261017:gate",
    "reason": "2 of 3 judge runs approved with p_yes >= 0.9 (mean 0.90 >= 0.9; 2 needed) and Jev gave 0.60 (>= 0.6 needed)."
  }
}
