Querying
Conditions, ordering, selection, scopes, raw clauses, and the raw-SQL escape hatches.
The querying section covers everything between "open a database" and
"execute": how chains accumulate WHERE conditions, how rows are ordered
and paginated, how columns are selected, and how to drop down to raw SQL
when the chain is not enough.
Every chainable returns a derivative *DB and never mutates the receiver —
see Chaining & copy-on-write for the session
model. To see what a chain will run, use ToSQL or DryRun
(Raw SQL & DryRun).
Dialects
Examples render SQLite and PostgreSQL side by side. Both dialects ship in-tree; builders branch on dialect capabilities, never on name strings.
Conditions
Where, Or, string/map/struct conditions, precedence, and the
soft-delete guarantee.
Order, Limit & Offset
ORDER BY, pagination, FOR UPDATE, and why Count strips ordering.
Select & Distinct
Column projection, aggregate scalars, and DISTINCT.
Scopes
Reusable named query fragments applied lazily at finisher time.
Raw clauses
Clauses and the clause package for anything the chainables skip.
Raw SQL & DryRun
Exec, Row/Rows/Scan, ToSQL, and captured-but-unexecuted
statements.
GROUP BY & HAVING
What to do while Group()/Having() are not implemented — honestly.