Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.sqlbuild.com/llms.txt

Use this file to discover all available pages before exploring further.

sqb janitor

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

Usage

sqb --project-dir <path> janitor [flags]

Flags

FlagDescription
--auto-approveSkip the confirmation prompt and delete immediately
--retention-daysOverride the configured retention period (days)

Configuration

Configure janitor behavior in sqlbuild_project.yml:
janitor:
  enabled: true
  retention_days: 30
  delete_tracked_only: true
  exclude_patterns:
    - "audit_*"
    - "tmp_*"
See Project Configuration for details on janitor settings.

Examples

# Interactive mode (prompts for confirmation)
sqb --project-dir examples/waffle_shop janitor

# Auto-approve deletion
sqb --project-dir examples/waffle_shop janitor --auto-approve

# Override retention to 7 days
sqb --project-dir examples/waffle_shop janitor --retention-days 7

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.