vacuum/v1
SQLite keeps a database file as big as it ever was; compacting it (VACUUM) gives the space freed by deleted records
back to the disk. This contract says who does that for an app, how often, and how the last run went.
A wire contract at /api/_c/vacuum/v1 (vacuum.go), one provider. On a single app the
vacuum extension provides it, on the schedule the app's admins set. A multisite host may
provide it for its instances instead: then the host compacts them on its own schedule, the app's vacuum extension steps
aside (no settings, no schedule of its own), and the app's admins see the host's status.
Use
curl -H "Authorization: <token with vacuum:read>" https://your.app/api/_c/vacuum/v1
provider is who compacts (vacuum for the app itself, or the host), enabled and every the schedule, last the
last run (bytes saved, databases skipped as not worth it, any error) and next the next one.
Provide
Implement vacuumv1.Vacuum and provide it in Register (vacuumv1.Contract.Provide(app, v)), or on a host for every
instance (vacuumv1.Contract.ProvideForInstances(hostScope, func(id string) vacuumv1.Vacuum {...})). An app half that
also has settings or a schedule checks extkit.HostProvides(app, "vacuum/v1") in Register and leaves them out when
the host owns it.
Commands and APIs
Every operation is a REST endpoint, a pocketone command and an MCP tool, all generated from the contract and behind the same token scope check and hooks. See Remote CLI, or the full CLI, Extension APIs and MCP references.
status
Says who compacts the app's databases, whether and how often, and how the last run went.
| REST | GET /api/_c/vacuum/v1 |
| CLI | pocketone remote vacuum status |
| MCP | vacuum_status |
| Token scope | vacuum:read |
Extensions
| Extension | |
|---|---|
| vacuum | provides |
License
MIT
Questions and comments
Comments are a GitHub Discussions thread; sign in with GitHub to post.