Skip to content

Operate typed-sql

The query compiler needs a schema snapshot and an authoritative check. The remaining operational features are optional controls that solve different deployment problems; adopting typed-sql does not require enabling all of them.

Choose a control

ConcernControlEvidence or outputWhen it runs
Stale schema inputSchema snapshotsCanonical snapshot and identityGeneration and CI
Query type correctnessCompiler checkDiagnostics and inferred contractsLocal development and CI
Query inventory and correlationQuery manifestsDeterministic, redacted manifestBuild or CI
Compiler/database agreementLive verificationCached verification artifactControlled CI environment
Optimizer regressionsQuery-plan governanceRedacted structured plans and review reportControlled CI environment
Rolling migration safetyMigration compatibilityForward and rollback compatibility findingsMigration review or CI
Runtime visibilityObservabilityLifecycle events or OpenTelemetry spansApplication runtime
Support investigationSupport bundlesPreviewed, redacted diagnostic archiveExplicit operator action

Minimum CI boundary

Generate or validate the snapshot, then run the stable compiler path:

sh
pnpm exec typed-sql check --project tsconfig.json

Snapshot generation can require a database connection. Checking uses the generated evidence and does not connect to the database unless live verification or plan inspection is explicitly configured.

Add evidence progressively

Start with the failure you need to prevent:

  1. Use snapshot drift checks when schema evidence can become stale.
  2. Emit manifests when deployments need a deterministic query inventory.
  3. Add live verification when compiler evidence must be compared with a controlled real database.
  4. Add plan governance only for queries and environments where optimizer changes are actionable.
  5. Run migration compatibility analysis when old and new application/schema versions overlap during deployment.

Each guide states its connection requirements, redaction rules, cache identity, and failure behavior. Do not copy production credentials into generated artifacts or support bundles.

Released under the MIT License.