mirror of
https://github.com/hay-kot/homebox.git
synced 2025-06-27 14:18:35 +00:00
chore: upgrade deps + code-gen (#249)
This commit is contained in:
parent
3d295b5132
commit
6ed1f3695a
42 changed files with 664 additions and 563 deletions
|
@ -31,6 +31,7 @@ type (
|
|||
Hook = ent.Hook
|
||||
Value = ent.Value
|
||||
Query = ent.Query
|
||||
QueryContext = ent.QueryContext
|
||||
Querier = ent.Querier
|
||||
QuerierFunc = ent.QuerierFunc
|
||||
Interceptor = ent.Interceptor
|
||||
|
@ -525,10 +526,11 @@ func withHooks[V Value, M any, PM interface {
|
|||
return nv, nil
|
||||
}
|
||||
|
||||
// newQueryContext returns a new context with the given QueryContext attached in case it does not exist.
|
||||
func newQueryContext(ctx context.Context, typ, op string) context.Context {
|
||||
// setContextOp returns a new context with the given QueryContext attached (including its op) in case it does not exist.
|
||||
func setContextOp(ctx context.Context, qc *QueryContext, op string) context.Context {
|
||||
if ent.QueryFromContext(ctx) == nil {
|
||||
ctx = ent.NewQueryContext(ctx, &ent.QueryContext{Type: typ, Op: op})
|
||||
qc.Op = op
|
||||
ctx = ent.NewQueryContext(ctx, qc)
|
||||
}
|
||||
return ctx
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue