added players

This commit is contained in:
2026-02-16 21:31:02 +11:00
parent bb3bed3e89
commit f8090aa0cc
17 changed files with 168 additions and 39 deletions

View File

@@ -37,6 +37,10 @@ func (g *fieldgetter[T]) Get(ctx context.Context) (*T, error) {
return g.get(ctx)
}
func (g *fieldgetter[T]) String() string {
return g.q.String()
}
func (g *fieldgetter[T]) Relation(name string, apply ...func(*bun.SelectQuery) *bun.SelectQuery) *fieldgetter[T] {
g.q = g.q.Relation(name, apply...)
return g
@@ -66,5 +70,6 @@ func GetByID[T any](
tx bun.Tx,
id int,
) *fieldgetter[T] {
return GetByField[T](tx, "id", id)
prefix := extractTableAlias[T]()
return GetByField[T](tx, prefix+".id", id)
}