examples/

directory
v0.0.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 11, 2026 License: Apache-2.0

README

Examples

One self-contained sqletch project per dialect, each with its committed oracle cache (so sqletch check runs offline):

  • postgres/ — the full showcase (guards, @choose, @when, HAVING, @order-by, @filter-tree, @in) with a runnable main.go (needs Docker or a DSN).
  • mysql/ — Tier 2 annotations, @in arity expansion, PATCH update; runnable via SQLETCH_MYSQL_DSN (cold generate needs Docker or a DSN).
  • sqlite/zero setup: go run . works with no server and no Docker; also shows -- @column for expression columns.

All three carry the same @filter-tree!(scope) query, so the required mode is shown end to end per dialect: And/Or over the generated predicate vocabulary, ErrFilterRequired for a forgotten filter, and the explicit FilterUsersUnscoped() opt-out.

Regenerate any of them with go run ./cmd/sqletch generate --config examples/<dialect>/sqletch.yaml.

Directories

Path Synopsis
A runnable sqletch MySQL showcase.
A runnable sqletch MySQL showcase.
gen
The examples app exercises the generated API end to end.
The examples app exercises the generated API end to end.
gen
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.
gen

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL