Documentation
¶
Overview ¶
Package errors provides database error mapping to domain errors. Each mapper translates driver-specific errors (constraint violations, not-found, schema errors) into core/errors.AppError with appropriate codes.
Only the generic, dependency-light mappers live here (Postgres via pgx/pgconn). An Ent-ORM mapper belongs with the consumer that owns the Ent schema, because it imports the schema-generated ent error predicates; that consumer's Ent store injects it as a DBMapperFunc — the seam type below — at its composition point.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DBMapperFunc ¶
DBMapperFunc maps a database error to an *AppError. Implementations must return nil when the input error is nil. A concrete ORM mapper (e.g. a consumer's Ent mapper) is a DBMapperFunc value injected by the store that owns that ORM.
func NewDBMapper ¶
func NewDBMapper(kind Kind) (DBMapperFunc, error)
NewDBMapper creates a DBMapperFunc for the specified kind. Returns an error if the kind is unknown.