Documentation ¶
Index ¶
- Variables
- func StoreTx(ctx context.Context, tx pgx.Tx) context.Context
- type App
- func (a App) Bulk(ctx context.Context, fetcher func() ([]any, error), schema, table string, ...) error
- func (a App) Close()
- func (a App) Create(ctx context.Context, query string, args ...any) (uint64, error)
- func (a App) DoAtomic(ctx context.Context, action func(context.Context) error) error
- func (a App) Enabled() bool
- func (a App) Exec(ctx context.Context, query string, args ...any) error
- func (a App) Get(ctx context.Context, scanner func(pgx.Row) error, query string, args ...any) error
- func (a App) List(ctx context.Context, scanner func(pgx.Rows) error, query string, args ...any) (err error)
- func (a App) One(ctx context.Context, query string, args ...any) error
- func (a App) Ping() error
- type Config
- type Database
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrNoHost occurs when host is not provided in configuration. ErrNoHost = errors.New("no host for database connection") // ErrNoTransaction occurs when no transaction is provided but needed. ErrNoTransaction = errors.New("no transaction in context, please wrap with DoAtomic()") // SQLTimeout when running queries. SQLTimeout = time.Second * 5 )
Functions ¶
Types ¶
type App ¶ added in v4.14.0
type App struct {
// contains filtered or unexported fields
}
func (App) Bulk ¶ added in v4.14.0
func (a App) Bulk(ctx context.Context, fetcher func() ([]any, error), schema, table string, columns ...string) error
Bulk load data into schema and table by batch.
func (App) List ¶ added in v4.14.0
func (a App) List(ctx context.Context, scanner func(pgx.Rows) error, query string, args ...any) (err error)
List execute multiple rows query.
Click to show internal directories.
Click to hide internal directories.