Skip to main content

sqb janitor

Identifies and removes stale warehouse relations that are no longer part of the project. Requires janitor.enabled = true in sqlbuild_project.toml.

Usage

Flags

Configuration

Configure janitor behavior in sqlbuild_project.toml:
See Project Configuration for details on janitor settings.

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.