(ctx context.Context)
| 64 | } |
| 65 | |
| 66 | func (_u *ZooUpdate) sqlSave(ctx context.Context) (_node int, err error) { |
| 67 | _spec := sqlgraph.NewUpdateSpec(zoo.Table, zoo.Columns, sqlgraph.NewFieldSpec(zoo.FieldID, field.TypeInt)) |
| 68 | if ps := _u.mutation.predicates; len(ps) > 0 { |
| 69 | _spec.Predicate = func(selector *sql.Selector) { |
| 70 | for i := range ps { |
| 71 | ps[i](selector) |
| 72 | } |
| 73 | } |
| 74 | } |
| 75 | if _node, err = sqlgraph.UpdateNodes(ctx, _u.driver, _spec); err != nil { |
| 76 | if _, ok := err.(*sqlgraph.NotFoundError); ok { |
| 77 | err = &NotFoundError{zoo.Label} |
| 78 | } else if sqlgraph.IsConstraintError(err) { |
| 79 | err = &ConstraintError{msg: err.Error(), wrap: err} |
| 80 | } |
| 81 | return 0, err |
| 82 | } |
| 83 | _u.mutation.done = true |
| 84 | return _node, nil |
| 85 | } |
| 86 | |
| 87 | // ZooUpdateOne is the builder for updating a single Zoo entity. |
| 88 | type ZooUpdateOne struct { |
nothing calls this directly
no test coverage detected