Directories
¶
| Path | Synopsis |
|---|---|
|
cmd
|
|
|
sqletch
command
Command sqletch is the statically verified, dynamically composed SQL compiler for Go.
|
Command sqletch is the statically verified, dynamically composed SQL compiler for Go. |
|
examples
|
|
|
mysql
command
A runnable sqletch MySQL showcase.
|
A runnable sqletch MySQL showcase. |
|
postgres
command
The examples app exercises the generated API end to end.
|
The examples app exercises the generated API end to end. |
|
sqlite
command
A zero-setup, runnable sqletch showcase: SQLite needs no server and no Docker — `go run .` seeds a throwaway database file and queries it through the generated, compile-time-verified API.
|
A zero-setup, runnable sqletch showcase: SQLite needs no server and no Docker — `go run .` seeds a throwaway database file and queries it through the generated, compile-time-verified API. |
|
internal
|
|
|
ast
Package ast implements phase P2: building verified renderings from a scanned template, with exact source maps back to the template file.
|
Package ast implements phase P2: building verified renderings from a scanned template, with exact source maps back to the template file. |
|
cache
Package cache holds the committed oracle cache and the catalog snapshot model.
|
Package cache holds the committed oracle cache and the catalog snapshot model. |
|
cli
Package cli implements the sqletch commands as testable functions; cmd/sqletch is thin cobra wiring over these.
|
Package cli implements the sqletch commands as testable functions; cmd/sqletch is thin cobra wiring over these. |
|
codegen
Package codegen emits the generated Go package: fragment tables, typed params/row structs, and one function per query.
|
Package codegen emits the generated Go package: fragment tables, typed params/row structs, and one function per query. |
|
config
Package config loads and validates sqletch.yaml.
|
Package config loads and validates sqletch.yaml. |
|
corpus
Package corpus is the oracle ground-truth corpus harness (design 15 §7.2).
|
Package corpus is the oracle ground-truth corpus harness (design 15 §7.2). |
|
devdb
Package devdb manages the development database the type oracle runs against: a user-supplied DSN, or an auto-managed disposable container.
|
Package devdb manages the development database the type oracle runs against: a user-supplied DSN, or an auto-managed disposable container. |
|
diagnostics
Package diagnostics defines the user-facing error model shared by every compiler phase.
|
Package diagnostics defines the user-facing error model shared by every compiler phase. |
|
dialect
Package dialect defines the driver interfaces separating the dialect-agnostic core from database specifics.
|
Package dialect defines the driver interfaces separating the dialect-agnostic core from database specifics. |
|
dialect/mysql
Package mysql implements the MySQL dialect driver (Tier 2).
|
Package mysql implements the MySQL dialect driver (Tier 2). |
|
dialect/postgres
Package postgres implements the PostgreSQL dialect driver.
|
Package postgres implements the PostgreSQL dialect driver. |
|
dialect/sqlite
Package sqlite implements the SQLite dialect driver (Tier 2).
|
Package sqlite implements the SQLite dialect driver (Tier 2). |
|
gosrc
Package gosrc extracts template text from Go source files.
|
Package gosrc extracts template text from Go source files. |
|
lsp
Package lsp implements the sqletch language server (docs/design/10-lsp.md): JSON-RPC 2.0 over stdio, a subset of the Language Server Protocol (diagnostics + go-to-definition), backed by an injected Workspace checker so the protocol layer never touches dialect drivers or the pipeline directly.
|
Package lsp implements the sqletch language server (docs/design/10-lsp.md): JSON-RPC 2.0 over stdio, a subset of the Language Server Protocol (diagnostics + go-to-definition), backed by an injected Workspace checker so the protocol layer never touches dialect drivers or the pipeline directly. |
|
nullability
Package nullability decides, per result column, whether the generated Go field must be a pointer — under the spec's per-shape-sound discipline: narrowing uses only the skeleton; guarded fragments NEVER narrow.
|
Package nullability decides, per result column, whether the generated Go field must be a pointer — under the spec's per-shape-sound discipline: narrowing uses only the skeleton; guarded fragments NEVER narrow. |
|
policy
Package policy implements cross-query policy weaving (design 14, spec §"Cross-Query Policies"): a boolean predicate declared once in sqletch.yaml, woven after the P1 scan and before rendering into every query that touches a designated table.
|
Package policy implements cross-query policy weaving (design 14, spec §"Cross-Query Policies"): a boolean predicate declared once in sqletch.yaml, woven after the P1 scan and before rendering into every query that touches a designated table. |
|
rules
Package rules implements the structural rule checks R1–R9.
|
Package rules implements the structural rule checks R1–R9. |
|
shape
Package shape computes and enumerates the reachable query shapes of a template: guard bitmask × one ordinal per @choose block.
|
Package shape computes and enumerates the reachable query shapes of a template: guard bitmask × one ordinal per @choose block. |
|
template
Package template implements phase P1: scanning .sql template files into a structured model (constant skeleton + guarded fragments) with exact source spans.
|
Package template implements phase P1: scanning .sql template files into a structured model (constant skeleton + guarded fragments) with exact source spans. |
|
Package runtime is the small public package imported by sqletch-generated code.
|
Package runtime is the small public package imported by sqletch-generated code. |
|
spike
|
|
|
wasm-oracle
command
Command wasm-oracle is the v0.4 spike mandated by docs/design/08-later-phases.md: boot libpglite's WASI build of PostgreSQL 16 in-process under wazero, expose its file-transport wire pump as a net.Conn, and run sqletch's UNMODIFIED postgres oracle (pgx-based) against it — Describe, Plan (GENERIC_PLAN), PlanText, Snapshot, ServerVersion — measuring cold-start against the < 2s budget and probing error recovery.
|
Command wasm-oracle is the v0.4 spike mandated by docs/design/08-later-phases.md: boot libpglite's WASI build of PostgreSQL 16 in-process under wazero, expose its file-transport wire pump as a net.Conn, and run sqletch's UNMODIFIED postgres oracle (pgx-based) against it — Describe, Plan (GENERIC_PLAN), PlanText, Snapshot, ServerVersion — measuring cold-start against the < 2s budget and probing error recovery. |
Click to show internal directories.
Click to hide internal directories.