MCPcopy Create free account
hub / github.com/chainloop-dev/chainloop / mutate

Method mutate

app/controlplane/pkg/data/ent/client.go:2510–2523  ·  view source on GitHub ↗
(ctx context.Context, m *ProjectMutation)

Source from the content-addressed store, hash-verified

2508}
2509
2510func (c *ProjectClient) mutate(ctx context.Context, m *ProjectMutation) (Value, error) {
2511 switch m.Op() {
2512 case OpCreate:
2513 return (&ProjectCreate{config: c.config, hooks: c.Hooks(), mutation: m}).Save(ctx)
2514 case OpUpdate:
2515 return (&ProjectUpdate{config: c.config, hooks: c.Hooks(), mutation: m}).Save(ctx)
2516 case OpUpdateOne:
2517 return (&ProjectUpdateOne{config: c.config, hooks: c.Hooks(), mutation: m}).Save(ctx)
2518 case OpDelete, OpDeleteOne:
2519 return (&ProjectDelete{config: c.config, hooks: c.Hooks(), mutation: m}).Exec(ctx)
2520 default:
2521 return nil, fmt.Errorf("ent: unknown Project mutation op: %q", m.Op())
2522 }
2523}
2524
2525// ProjectVersionClient is a client for the ProjectVersion schema.
2526type ProjectVersionClient struct {

Callers

nothing calls this directly

Calls 4

HooksMethod · 0.95
SaveMethod · 0.65
ExecMethod · 0.65
OpMethod · 0.45

Tested by

no test coverage detected