Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // Module is default connection to PostgreSQL Module = module.Module{ {Constructor: NewDefaultConfig}, {Constructor: NewConnection}, } // ErrEmptyConfig when given empty options ErrEmptyConfig = errors.New("database empty config") // ErrEmptyLogger when logger not initialized ErrEmptyLogger = errors.New("database empty logger") )
Functions ¶
Types ¶
type Config ¶
type Config = struct { Addr string User string Password string Database string Debug bool PoolSize int Logger *zap.SugaredLogger }
Config alias
type Hook ¶ added in v0.9.0
type Hook struct { StartAt time.Time Before func(*pg.QueryEvent) After func(*pg.QueryEvent) }
Hook is a simple implementation of pg.QueryHook
func (Hook) AfterQuery ¶ added in v0.9.0
func (h Hook) AfterQuery(e *pg.QueryEvent)
AfterQuery callback
func (*Hook) BeforeQuery ¶ added in v0.9.0
func (h *Hook) BeforeQuery(e *pg.QueryEvent)
BeforeQuery callback
Click to show internal directories.
Click to hide internal directories.