scan --reporter json, diff --fail-on-diff, check, and optional verify. Protected deploy jobs can run sync with one configured target and an explicit remote approval environment variable. The CLI and GitHub Action also provide type-contract --enforce for breaking generated-type changes.
Use this when
- The repository owns declarative schema files.
- Pull requests should fail on drift.
- Unsafe SQL should show as PR annotations or SARIF.
- RLS predicate changes need explicit review.
Do this
Start with the free CI layer:--contract-usage <dir> when the repository wants the scan report to include generated-contract import renames, query response overrides, assertions, and local copies of generated runtime roots.
Use SARIF when the organization wants findings in GitHub code scanning:
Decide
- Which branches require drift checks.
- Whether
verifyruns on every PR or only protected branches. - Who can approve destructive hints.
- Whether your organization needs additional policy enforcement outside this repository.
Related
CI recipe
Copy a full GitHub Actions workflow.
Check command
Add PR annotations and SARIF output.
Verify command
Run apply-twice verification.
Benchmarks
Review timing and replay-safety evidence.

