sqb janitor
Identifies and removes stale warehouse relations that are no longer part of the project. Requiresjanitor.enabled = true in sqlbuild_project.toml.
Usage
Flags
| Flag | Description |
|---|---|
--auto-approve | Skip the confirmation prompt and delete immediately |
--retention-days | Override the configured retention period (days) |
Configuration
Configure janitor behavior insqlbuild_project.toml:
Examples
State history pruning
In addition to cleaning up stale relations, the janitor prunes old rows from_sqlbuild_fingerprints and _sqlbuild_source_freshness tables, retaining only the latest record per identity. This keeps state tables compact without affecting change detection.
Safety
Janitor prompts for confirmation before deleting. The confirmation requires typing an exact string to prevent accidental deletion. Use--auto-approve only in CI or when you’re certain.
