Generation diagnostics reference¶
Diagnostic structure¶
type Diagnostic struct {
Severity Severity
Path string
Context string
Model string
Relation string
Query string
Message string
Hint string
}
Example¶
error: contexts.content.models.User.operations.insert
query CreateUser uses :exec, but the default insert lifecycle requires
:one so the persisted row can hydrate generated fields.
Hint: add RETURNING ... and change the annotation to :one, or select an
explicit non-hydrating insert policy when that policy becomes supported.
Required validation stages¶
- Configuration schema validation.
- Context and package validation.
- Model and field mapping validation.
- Query name and annotation validation.
- Parameter mapping validation.
- Result-hydration validation.
- Relation graph validation.
- Scope compatibility validation.
- File/declaration collision validation.
- Go formatting validation.
Failure behavior¶
Any error-severity diagnostic prevents all output. Warnings may be emitted for discouraged but valid behavior, such as a delete query using :exec without affected-row detection.
Determinism¶
Diagnostics are sorted by configuration path and stable identifiers: path, context, model, relation, then query. Repeated runs over unchanged input produce identical output.