Documentation
¶
Index ¶
- Variables
- type Helper
- func (h *Helper) Connect(ctx context.Context) 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) InTx(ctx context.Context, cb func(ctx context.Context, 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 JobQueueOptions
- type NewHelperOptions
- type PostgresOptions
- type SQLiteOptions
- type Tx
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrNoRows = sql.ErrNoRows
Functions ¶
This section is empty.
Types ¶
type Helper ¶
type Helper struct {
DB *sqlx.DB
JobsQ, JobsQCPU *goqite.Queue
// contains filtered or unexported fields
}
func NewHelper ¶
func NewHelper(opts NewHelperOptions) *Helper
NewHelper with the given options. If no logger is provided, logs are discarded. For documentation on OTel spans and attributes, see https://opentelemetry.io/docs/specs/semconv/database/database-spans/
type JobQueueOptions ¶
type NewHelperOptions ¶
type NewHelperOptions struct {
JobQueue JobQueueOptions
Log *slog.Logger
Postgres PostgresOptions
SQLite SQLiteOptions
}
type PostgresOptions ¶
type SQLiteOptions ¶
type SQLiteOptions struct {
Path string
}
Click to show internal directories.
Click to hide internal directories.