wp-go/model/universal.go

21 lines
463 B
Go
Raw Normal View History

2023-02-10 13:23:30 +00:00
package model
import "context"
type UniversalDb struct {
selects QueryFn
gets QueryFn
}
func NewUniversalDb(selects QueryFn, gets QueryFn) UniversalDb {
return UniversalDb{selects: selects, gets: gets}
}
func (u UniversalDb) Select(ctx context.Context, a any, s string, args ...any) error {
return u.selects(ctx, a, s, args...)
}
func (u UniversalDb) Get(ctx context.Context, a any, s string, args ...any) error {
return u.gets(ctx, a, s, args...)
}