and another one
This commit is contained in:
@@ -31,15 +31,11 @@ func (g *fieldgetter[T]) get(ctx context.Context) (*T, error) {
|
||||
return g.model, nil
|
||||
}
|
||||
|
||||
func (g *fieldgetter[T]) GetFirst(ctx context.Context) (*T, error) {
|
||||
func (g *fieldgetter[T]) Get(ctx context.Context) (*T, error) {
|
||||
g.q = g.q.Limit(1)
|
||||
return g.get(ctx)
|
||||
}
|
||||
|
||||
func (g *fieldgetter[T]) GetAll(ctx context.Context) (*T, error) {
|
||||
return g.get(ctx)
|
||||
}
|
||||
|
||||
func (g *fieldgetter[T]) Relation(name string, apply ...func(*bun.SelectQuery) *bun.SelectQuery) *fieldgetter[T] {
|
||||
g.q = g.q.Relation(name, apply...)
|
||||
return g
|
||||
|
||||
Reference in New Issue
Block a user