entc/gen: support Append<F> for JSON array fields (#2975)

This commit is contained in:
Ariel Mashraki
2022-09-29 16:57:54 +03:00
committed by GitHub
parent 957d3c0098
commit 13bf27bdd6
36 changed files with 567 additions and 88 deletions

View File

@@ -415,6 +415,16 @@ type (
}
)
// AddModifier adds a new statement modifier to the spec.
func (u *UpdateSpec) AddModifier(m func(*sql.UpdateBuilder)) {
u.Modifiers = append(u.Modifiers, m)
}
// AddModifiers adds a list of statement modifiers to the spec.
func (u *UpdateSpec) AddModifiers(m ...func(*sql.UpdateBuilder)) {
u.Modifiers = append(u.Modifiers, m...)
}
// UpdateNode applies the UpdateSpec on one node in the graph.
func UpdateNode(ctx context.Context, drv dialect.Driver, spec *UpdateSpec) error {
tx, err := drv.Tx(ctx)