Directory Compare FCRS-1.0 /llms.txt
← Back to Directory

sqlc

$ sqlc Official Low Risk
sqlc · Database & Data · MIT · macos / linux / windows

sqlc parses SQL DDL schemas and annotated .sql queries to generate idiomatic, type-safe database access code (sqlc generate). Agents can verify SQL correctness offline with sqlc compile, check lint rules with sqlc vet, and assert zero generated-file drift via sqlc diff.

FCRS-1.0 Score
90 /100
Excellent
Medium Confidence
Zero-Friction Install
brew install sqlc
CLI vs MCP Decision CLI Only

sqlc compile, sqlc vet, and sqlc generate are local build-pipeline compiler commands with no meaningful MCP equivalent.

Agent-Readiness Checklist

— JSON Output
— Field Filtering
✓ Non-Interactive
— Dry-Run
✓ Read-Only Mode
— NO_COLOR Clean
✓ Self-Describing
— Official SKILL.md

Static evaluation (not yet probed on this host). Run npm run data:probe locally to capture live verification.

FCRS-1.0 6-Dimension Breakdown

Agent-Readiness 21 / 25

Deterministic headless compile, vet, diff, and generate subcommands with crisp compiler error diagnostics, though lacks a --json output flag.

  • Offline sqlc compile --no-database and sqlc diff exit codes
  • Human-readable compiler errors without --json
Trust & Safety 24 / 25

Pure static compiler by default (--no-database); sqlc generate only writes configured local source files.

  • Zero database writes; --no-database guarantees offline execution
Setup & Portability 14 / 15

Single Go binary installable via Homebrew, go install, Docker, and official downloads across macOS, Linux, and Windows.

  • Static Go binary via brew install sqlc
Utility & Efficiency 15 / 15

Eliminates ORM boilerplate and catches SQL typos/type mismatches at compile time before running tests.

  • Generates type-safe bindings for Go, Python, TypeScript, and Kotlin
Maintenance & Lineage 8 / 10

Actively maintained by sqlc-dev/sqlc under MIT license with broad production usage.

  • Official sqlc-dev/sqlc repository under MIT
Docs & Verifiability 8 / 10

Clear CLI reference, sqlc.yaml config docs, and sqlc vet CEL rule examples at docs.sqlc.dev.

  • Structured reference documentation at docs.sqlc.dev

Security, Auth & Guardrails

Auth Modes
No Auth Config File Env API Key
Credential Storage

Offline compiler needs no credentials; optional SQLC_AUTH_TOKEN and DB URIs in sqlc.yaml apply only to managed verification or sqlc vet EXPLAIN rules.

Side Effects
Read-Only Local Write
Cost & Quotas

MIT open-source compiler; optional sqlc Cloud managed database features are commercial.

Copyable Guardrail for CLAUDE.md / AGENTS.md
# sqlc Agent Rules
- Run `sqlc generate && sqlc vet --no-database` after editing `.sql` query or schema files.
- Use `--no-database` during static checks unless live `EXPLAIN` plan linting is explicitly configured.

Agent-Ready Command Recipes

Safe Read-Only Queries

Type-check SQL queries without writing files
sqlc compile --no-database

Statically validates SQL syntax, column names, and parameter types against schemas offline.

Check for unregenerated code drift and lint issues
sqlc diff && sqlc vet --no-database

Verifies generated code matches disk and evaluates CEL query lint rules without touching a database.

Controlled Writes & Previews

Regenerate type-safe query bindings
sqlc generate

Writes generated Go/Python/TypeScript/Kotlin source files configured in sqlc.yaml.

Strengths for Agents

  • + sqlc compile and sqlc vet catch SQL schema/query errors statically in milliseconds.
  • + sqlc diff prevents stale generated code in PRs and agent edits.
  • + Zero runtime dependencies and deterministic local code generation.

Caveats & Pitfalls

  • ! No --json output flag for structured error diagnostics.
  • ! Dynamic SQL builders require workarounds since sqlc targets static annotated .sql queries.

Tested Agent Hosts

Claude Code Codex CLI Gemini CLI