Quarry Docs
GitHub
Reference

Package Map

Quarry has a small public surface. This page shows what each package is for, whether it is core or optional, and which import path to reach for first.

Quarry logo

Public packages

Import path Purpose Core or optional Minimal example
github.com/sphireinc/quarry Root builder API, identifiers, predicates, and dialect policy. Core qq := quarry.New(quarry.Postgres)
github.com/sphireinc/quarry/scan Execute Quarry queries and scan rows into Go values. Optional users, err := scan.All[User](ctx, db, q)
github.com/sphireinc/quarry/codex Named raw queries and reusable recipes. Optional cx := codex.New()

Internal packages

Not public API

internal/rawsql is an internal implementation detail used by Quarry and Codex for placeholder rewriting. It is not meant to be imported directly.

Hydra stays external

Companion project

Quarry keeps lightweight scanning in-tree. For richer hydration workflows, use the standalone Hydra integration note and the external Hydra project.

Which package should I import?

Start with quarry

If you are building SQL, this is the package you want first. Everything else is optional.

Add scan when execution matters

Use it when you want Quarry to render SQL and scan rows through database/sql. The scan layer keeps SQL visible; it does not sanitize arbitrary fragments.

Add codex when reuse matters

Use it when named templates or recipes keep repeated query shapes readable.