wp-go/model/universal.go
2023-02-10 21:23:30 +08:00

21 lines
463 B
Go

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...)
}