dbutil

package
v0.0.0-...-19239a5 Latest Latest
Warning

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

Go to latest
Published: Oct 7, 2021 License: EUPL-1.2 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	AscOrder  = "asc"
	DescOrder = "desc"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Configuration

type Configuration struct {
	Host       string
	Port       int
	Name       string
	User       string
	Password   string
	LogQueries bool
}

func NewConfig

func NewConfig(defaultConfig Configuration) Configuration

type Connector

type Connector struct {
	// contains filtered or unexported fields
}

func NewConnector

func NewConnector(config Configuration) *Connector

func (*Connector) Close

func (c *Connector) Close()

func (*Connector) GetDb

func (c *Connector) GetDb(ctx goContext.Context) orm.DB

func (*Connector) RunInTransaction

func (c *Connector) RunInTransaction(ctx goContext.Context, fn func(goContext.Context) error) error

type IntegrityViolationError

type IntegrityViolationError struct {
	Message string
}

func (IntegrityViolationError) Error

func (e IntegrityViolationError) Error() string

type Logger

type Logger struct{}

func (Logger) AfterQuery

func (Logger) AfterQuery(ctx goContext.Context, q *pg.QueryEvent) error

func (Logger) BeforeQuery

func (Logger) BeforeQuery(ctx goContext.Context, q *pg.QueryEvent) (goContext.Context, error)

type NotFoundError

type NotFoundError struct {
	Message string
}

func (NotFoundError) Error

func (e NotFoundError) Error() string

Jump to

Keyboard shortcuts

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