Versions in this module Expand all Collapse all v1 v1.9.0 Jul 22, 2020 Changes in this version + func GetMigrate() (*migrate.Migrate, error) + func NewDB() (*pg.DB, error) + func RebuildDB() error + type PgContextData struct + DB *pg.DB + Layer int + Tx *pg.Tx + func (d *PgContextData) GetSession() Session + type Session interface + Exec func(query interface{}, params ...interface{}) (pg.Result, error) + Insert func(model ...interface{}) error + Model func(model ...interface{}) *orm.Query + Query func(model interface{}, query interface{}, params ...interface{}) (pg.Result, error) + func GetSessionFromContext(ctx context.Context) Session + type TxAdapter struct + DB *pg.DB + func (tx *TxAdapter) AttachDB(ctx context.Context) context.Context + func (tx *TxAdapter) WithTx(ctx context.Context, fn func() error) error