postgres

package
v0.23.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 21, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package postgres adapts PostgreSQL driver errors to GoForge ORM errors.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Classify

func Classify(err error) error

Classify converts known PostgreSQL SQLSTATEs to driver-neutral ORM errors.

When err is a PersistenceError, the persistence error remains outermost and the classified error replaces its cause. The resulting chain is therefore:

PersistenceError -> ConstraintError/TransientError -> safeCause -> PgError

This preserves operation and table context together with errors.Is/errors.As access to the native error. safeCause prevents PostgreSQL messages and detail fields, which may contain submitted values, from reaching Error output. Context errors, unknown errors, and nil pass through unchanged.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL