postgres

package
v1.1.6 Latest Latest
Warning

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

Go to latest
Published: Oct 9, 2022 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ErrUnknown          = iota
	ErrUniqueViolation  = iota
	ErrNotNullViolation = iota
	ErrRecordNotFound   = iota
	ErrInvalidText      = iota
)

Variables

This section is empty.

Functions

func DialPostgres

func DialPostgres(c *config.Config) (*gorm.DB, func(), error)

func ErrorCode

func ErrorCode(err error) int

func TranslateError

func TranslateError(err error) *pgconn.PgError

Types

type Error

type Error struct {
	Err        error
	Code       int
	Constraint string
	TableName  string
	ColumnName string
}

type LockingService

type LockingService interface {
	Acquire(lockID int64) (bool, error)
	Release(lockID int64) error
}

func NewLockingService

func NewLockingService(db *gorm.DB) LockingService

Jump to

Keyboard shortcuts

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