pqerrors

package
v0.16.8 Latest Latest
Warning

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

Go to latest
Published: Jan 11, 2021 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CondCodeEq

func CondCodeEq(code string) errors.MapCond

CondCodeEq function returns a condition function that matches a particular constraint code.

func CondConstraintEq

func CondConstraintEq(c string) errors.MapCond

CondConstraintEq function returns a condition function that matches a particular constraint name.

func CondPQ

func CondPQ() errors.MapCond

CondPQ function returns a condition function that matches standard lib/pq error.

func NewForeignKeyMapping

func NewForeignKeyMapping(c string, t1 string, t2 string) errors.MapFunc

NewForeignKeyMapping function returns a mapping function that performs mapping of a constraint name (c) to specific foreign key message with user-friendly referencing (t1) and referenced (t2) table names provided.

func NewNotNullMapping

func NewNotNullMapping(c string, t string, col string) errors.MapFunc

NewNotNullMapping function returns a mapping function that performs mapping of a constraint name (c) to specific not-null violation error message with user-friendly table (t) name and column (col) name provided.

func NewRestrictMapping

func NewRestrictMapping(c string, t1 string, t2 string) errors.MapFunc

NewRestrictMapping function returns a mapping function that performs mapping of a constraint name (c) to specific restrict violation error message with user-friendly referencing (t1) and referenced (t2) table names provided.

func NewUniqueMapping

func NewUniqueMapping(c string, t string, col string) errors.MapFunc

NewUniqueMapping function returns a mapping function that performs mapping of a constraint name (c) to a specific unique violation error message with user-friendly table name (t) and column (col) name provided.

func ToMapFunc

func ToMapFunc(f func(context.Context, *pq.Error) (error, bool)) errors.MapFunc

ToMapFunc function converts mapping function for *pq.Error to a conventional MapFunc from atlas-app-toolkit/errors package.

Types

This section is empty.

Jump to

Keyboard shortcuts

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