Practical Patterns
The first four pages are app-shaped walkthroughs. The scan examples after them show the lightweight row-mapping surface Quarry keeps in-tree: one row, many rows, and a Quarry query fed straight into scan.
Walkthroughs
Search endpoint
A request-driven list endpoint with optional filters, safe ordering, and pagination.
Admin edit form
A form-driven edit flow that keeps partial updates, returning, and validation explicit.
Reporting query
A heavier query with aggregates, joins, and a raw fragment where the SQL is still the clearest expression.
Feed/list endpoint
A content-feed query that combines cursor-style pagination, optional filters, and scan-friendly result shaping.
Search and filters
The older filter-heavy walkthrough, kept around as a reference for reusable query shapes.
Scan examples
Scan one row
A strict one-row struct scan with scan.One and a tiny fake driver.
Scan many rows
A slice-of-struct example that keeps the row shape visible and boring.
Scan with Quarry query
A Quarry-built scalar query scanned through scan.One.
How to read these pages
- Start with the walkthrough that matches the shape of the endpoint or job you are building.
- Use the longer examples when you want to see edge cases and SQL output together.
- Keep the query shape, then swap in your own schema and request types.
- Trim the pattern to fit your app after you understand the tradeoffs it is showing.