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). The Ent-ORM mapper is product-side (contracts/ent/errmap.MapEntError) because it imports the schema-generated ent error predicates; a product 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. the product'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.