(ctx context.Context)
| 352 | } |
| 353 | |
| 354 | func (_u *DecisionUpdateOne) sqlSave(ctx context.Context) (_node *Decision, err error) { |
| 355 | _spec := sqlgraph.NewUpdateSpec(decision.Table, decision.Columns, sqlgraph.NewFieldSpec(decision.FieldID, field.TypeInt)) |
| 356 | id, ok := _u.mutation.ID() |
| 357 | if !ok { |
| 358 | return nil, &ValidationError{Name: "id", err: errors.New(`ent: missing "Decision.id" for update`)} |
| 359 | } |
| 360 | _spec.Node.ID.Value = id |
| 361 | if fields := _u.fields; len(fields) > 0 { |
| 362 | _spec.Node.Columns = make([]string, 0, len(fields)) |
| 363 | _spec.Node.Columns = append(_spec.Node.Columns, decision.FieldID) |
| 364 | for _, f := range fields { |
| 365 | if !decision.ValidColumn(f) { |
| 366 | return nil, &ValidationError{Name: f, err: fmt.Errorf("ent: invalid field %q for query", f)} |
| 367 | } |
| 368 | if f != decision.FieldID { |
| 369 | _spec.Node.Columns = append(_spec.Node.Columns, f) |
| 370 | } |
| 371 | } |
| 372 | } |
| 373 | if ps := _u.mutation.predicates; len(ps) > 0 { |
| 374 | _spec.Predicate = func(selector *sql.Selector) { |
| 375 | for i := range ps { |
| 376 | ps[i](selector) |
| 377 | } |
| 378 | } |
| 379 | } |
| 380 | if value, ok := _u.mutation.UpdatedAt(); ok { |
| 381 | _spec.SetField(decision.FieldUpdatedAt, field.TypeTime, value) |
| 382 | } |
| 383 | if value, ok := _u.mutation.Until(); ok { |
| 384 | _spec.SetField(decision.FieldUntil, field.TypeTime, value) |
| 385 | } |
| 386 | if _u.mutation.UntilCleared() { |
| 387 | _spec.ClearField(decision.FieldUntil, field.TypeTime) |
| 388 | } |
| 389 | if _u.mutation.StartIPCleared() { |
| 390 | _spec.ClearField(decision.FieldStartIP, field.TypeInt64) |
| 391 | } |
| 392 | if _u.mutation.EndIPCleared() { |
| 393 | _spec.ClearField(decision.FieldEndIP, field.TypeInt64) |
| 394 | } |
| 395 | if _u.mutation.StartSuffixCleared() { |
| 396 | _spec.ClearField(decision.FieldStartSuffix, field.TypeInt64) |
| 397 | } |
| 398 | if _u.mutation.EndSuffixCleared() { |
| 399 | _spec.ClearField(decision.FieldEndSuffix, field.TypeInt64) |
| 400 | } |
| 401 | if _u.mutation.IPSizeCleared() { |
| 402 | _spec.ClearField(decision.FieldIPSize, field.TypeInt64) |
| 403 | } |
| 404 | if _u.mutation.UUIDCleared() { |
| 405 | _spec.ClearField(decision.FieldUUID, field.TypeString) |
| 406 | } |
| 407 | if _u.mutation.OwnerCleared() { |
| 408 | edge := &sqlgraph.EdgeSpec{ |
| 409 | Rel: sqlgraph.M2O, |
| 410 | Inverse: true, |
| 411 | Table: decision.OwnerTable, |
nothing calls this directly
no test coverage detected