Documentation
¶
Index ¶
- Variables
- type Helper
- func (h *Helper) Connect() error
- func (h *Helper) Exec(ctx context.Context, query string, args ...any) error
- func (h *Helper) Get(ctx context.Context, dest any, query string, args ...any) error
- func (h *Helper) InTransaction(ctx context.Context, callback func(tx *Tx) error) (err error)
- func (h *Helper) MigrateDown(ctx context.Context) error
- func (h *Helper) MigrateUp(ctx context.Context) error
- func (h *Helper) Ping(ctx context.Context) error
- func (h *Helper) Select(ctx context.Context, dest any, query string, args ...any) error
- type NewHelperOptions
- type Tx
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrNoRows = sql.ErrNoRows
Functions ¶
This section is empty.
Types ¶
type Helper ¶
func NewHelper ¶
func NewHelper(opts NewHelperOptions) *Helper
NewHelper with the given options. If no logger is provided, logs are discarded.
func (*Helper) InTransaction ¶
InTransaction runs callback in a transaction, and makes sure to handle rollbacks, commits etc.
type NewHelperOptions ¶
Click to show internal directories.
Click to hide internal directories.