Reference
Error Returns
The public error surface is intentionally small. Quarry wraps failures with
context, but the important cases still support errors.Is.
Sentinel errors
| Error | What it means | Common source |
|---|---|---|
quarry.ErrInvalidIdentifier |
An identifier failed the local syntax check. | quarry.T, quarry.C, aliases, and dialect quoting. |
quarry.ErrUnsupportedFeature |
The active dialect cannot render a requested feature. | RETURNING on MySQL, ANY outside Postgres, unsupported dialects. |
quarry.ErrInvalidBuilderState |
The builder configuration is incomplete or contradictory. | Zero-value builders, nil subqueries, empty SET lists, invalid comparisons. |
quarry.ErrPlaceholderMismatch |
The raw SQL placeholder scan could not match args to placeholders. | Too few args, too many args, or invalid placeholder binding in raw queries. |
How to check
sql, _, err := q.ToSQL()
if err != nil {
if errors.Is(err, quarry.ErrUnsupportedFeature) {
// fall back or fail fast
}
}
Design rules
- Quarry prefers wrapped errors with context over silent fallback behavior.
- These sentinel values are meant to stay consistent so callers and tests can check them directly.
- Normal usage should return an error instead of panicking.