dberr

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Aug 1, 2026 License: MPL-2.0 Imports: 3 Imported by: 0

Documentation

Overview

Package dberr classifies the database errors the CMS reacts to, across every supported engine.

It replaces the Postgres-only internal/pgutil. Each function checks both engines' error types, so call sites need no dialect of their own — an error can only have come from the driver that is actually in use.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsForeignKeyViolation

func IsForeignKeyViolation(err error) bool

IsForeignKeyViolation reports whether err is a foreign-key violation — Postgres SQLSTATE 23503, MySQL errors 1451/1452 (and the older 1216/1217) — e.g. referencing a deleted page.

func IsUniqueViolation

func IsUniqueViolation(err error) bool

IsUniqueViolation reports whether err is a unique-constraint violation — Postgres SQLSTATE 23505, MySQL error 1062.

Types

This section is empty.

Jump to

Keyboard shortcuts

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