db

package
v0.0.0-...-e8003ba Latest Latest
Warning

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

Go to latest
Published: Aug 24, 2025 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewDuplicateKeyError

func NewDuplicateKeyError(field string, err error) error

NewDuplicateKeyError creates a new DuplicateKeyError

func NewDuplicateKeyErrorWithValue

func NewDuplicateKeyErrorWithValue(field, value string, err error) error

NewDuplicateKeyErrorWithValue creates a new DuplicateKeyError with value Be careful with sensitive data like emails

func WrapErrorIfDuplciateConstraint

func WrapErrorIfDuplciateConstraint(err error) (bool, error)

ErrorIsDuplicateConstraint

Types

type DuplicateKeyError

type DuplicateKeyError struct {
	Field string // The field that caused the constraint violation
	Value string // The value that was duplicated (optional, might be sensitive)
	// contains filtered or unexported fields
}

DuplicateKeyError represents a database constraint violation error

func (*DuplicateKeyError) Error

func (e *DuplicateKeyError) Error() string

func (*DuplicateKeyError) GetField

func (e *DuplicateKeyError) GetField() string

GetField returns the field that caused the violation

func (*DuplicateKeyError) Unwrap

func (e *DuplicateKeyError) Unwrap() error

Unwrap returns the underlying error for error chain support

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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