(ctx context.Context)
| 595 | } |
| 596 | |
| 597 | func (gcuo *GitCommitUpdateOne) sqlSave(ctx context.Context) (_node *GitCommit, err error) { |
| 598 | _spec := sqlgraph.NewUpdateSpec(gitcommit.Table, gitcommit.Columns, sqlgraph.NewFieldSpec(gitcommit.FieldID, field.TypeUUID)) |
| 599 | id, ok := gcuo.mutation.ID() |
| 600 | if !ok { |
| 601 | return nil, &ValidationError{Name: "id", err: errors.New(`ent: missing "GitCommit.id" for update`)} |
| 602 | } |
| 603 | _spec.Node.ID.Value = id |
| 604 | if fields := gcuo.fields; len(fields) > 0 { |
| 605 | _spec.Node.Columns = make([]string, 0, len(fields)) |
| 606 | _spec.Node.Columns = append(_spec.Node.Columns, gitcommit.FieldID) |
| 607 | for _, f := range fields { |
| 608 | if !gitcommit.ValidColumn(f) { |
| 609 | return nil, &ValidationError{Name: f, err: fmt.Errorf("ent: invalid field %q for query", f)} |
| 610 | } |
| 611 | if f != gitcommit.FieldID { |
| 612 | _spec.Node.Columns = append(_spec.Node.Columns, f) |
| 613 | } |
| 614 | } |
| 615 | } |
| 616 | if ps := gcuo.mutation.predicates; len(ps) > 0 { |
| 617 | _spec.Predicate = func(selector *sql.Selector) { |
| 618 | for i := range ps { |
| 619 | ps[i](selector) |
| 620 | } |
| 621 | } |
| 622 | } |
| 623 | if value, ok := gcuo.mutation.UpdateTime(); ok { |
| 624 | _spec.SetField(gitcommit.FieldUpdateTime, field.TypeTime, value) |
| 625 | } |
| 626 | if value, ok := gcuo.mutation.CommitHash(); ok { |
| 627 | _spec.SetField(gitcommit.FieldCommitHash, field.TypeString, value) |
| 628 | } |
| 629 | if value, ok := gcuo.mutation.BranchName(); ok { |
| 630 | _spec.SetField(gitcommit.FieldBranchName, field.TypeString, value) |
| 631 | } |
| 632 | if value, ok := gcuo.mutation.RepoName(); ok { |
| 633 | _spec.SetField(gitcommit.FieldRepoName, field.TypeString, value) |
| 634 | } |
| 635 | if value, ok := gcuo.mutation.CommitMessage(); ok { |
| 636 | _spec.SetField(gitcommit.FieldCommitMessage, field.TypeString, value) |
| 637 | } |
| 638 | if value, ok := gcuo.mutation.CommitTimestamp(); ok { |
| 639 | _spec.SetField(gitcommit.FieldCommitTimestamp, field.TypeTime, value) |
| 640 | } |
| 641 | if value, ok := gcuo.mutation.Author(); ok { |
| 642 | _spec.SetField(gitcommit.FieldAuthor, field.TypeString, value) |
| 643 | } |
| 644 | if gcuo.mutation.AuthorCleared() { |
| 645 | _spec.ClearField(gitcommit.FieldAuthor, field.TypeString) |
| 646 | } |
| 647 | if value, ok := gcuo.mutation.Timestamp(); ok { |
| 648 | _spec.SetField(gitcommit.FieldTimestamp, field.TypeTime, value) |
| 649 | } |
| 650 | if gcuo.mutation.TimestampCleared() { |
| 651 | _spec.ClearField(gitcommit.FieldTimestamp, field.TypeTime) |
| 652 | } |
| 653 | if value, ok := gcuo.mutation.PrNumber(); ok { |
| 654 | _spec.SetField(gitcommit.FieldPrNumber, field.TypeString, value) |
nothing calls this directly
no test coverage detected