wp-go/model/universal.go

17 lines
351 B
Go
Raw Normal View History

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