Documentation
¶
Index ¶
- func ForFeature[R any](fn func(DB) R, opts ...ligo.ProviderOption) ligo.Provider
- func Module(db DB) ligo.Module
- func ModuleNamed(name string, db DB) ligo.Module
- func RunInTx(ctx context.Context, db DB, fn func(ctx context.Context) error) error
- func WithTx(ctx context.Context, tx Tx) context.Context
- type BaseRepository
- func (r *BaseRepository) DB(ctx context.Context) Querier
- func (r *BaseRepository) Exec(ctx context.Context, query string, args ...any) (Result, error)
- func (r *BaseRepository) Query(ctx context.Context, query string, args ...any) (Rows, error)
- func (r *BaseRepository) QueryRow(ctx context.Context, query string, args ...any) Row
- type DB
- type DBRegistry
- type HealthChecker
- type Querier
- type Result
- type Row
- type Rows
- type Tx
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ForFeature ¶
Types ¶
type BaseRepository ¶
type BaseRepository struct {
// contains filtered or unexported fields
}
func NewBaseRepository ¶
func NewBaseRepository(db DB) *BaseRepository
type DBRegistry ¶
type DBRegistry struct {
// contains filtered or unexported fields
}
func NewDBRegistry ¶
func NewDBRegistry() *DBRegistry
func (*DBRegistry) Default ¶
func (r *DBRegistry) Default() DB
func (*DBRegistry) Get ¶
func (r *DBRegistry) Get(name string) DB
func (*DBRegistry) Register ¶
func (r *DBRegistry) Register(name string, db DB)
func (*DBRegistry) RegisterDefault ¶
func (r *DBRegistry) RegisterDefault(db DB)
type HealthChecker ¶
type HealthChecker struct {
DB DB
}
Click to show internal directories.
Click to hide internal directories.