Collection API reference¶
A collection is the Go equivalent of the static model entry point found in class-oriented Active Record APIs.
Create a new model¶
The returned model is attached to the collection session and does not yet exist in the database.
Find by identifier¶
No row returns ErrNotFound. The collection does not expose a panic-based FindOrFail in the baseline API.
Named retrieval methods¶
Configured compatible sqlc queries may generate methods such as:
The generator never derives these methods from column names alone.
Query entry point¶
UserQuery is a typed configuration object for predefined sqlc capabilities, not a general runtime SQL builder.
Every scope and eager-load option must resolve to configured query parameters or variants.