(ctx context.Context)
| 721 | } |
| 722 | |
| 723 | func (s setCreateOrUpdateG[T]) Create(ctx context.Context) error { |
| 724 | // Execute association operations |
| 725 | for _, assocOp := range s.assocOps { |
| 726 | if err := s.executeAssociationOperation(ctx, assocOp); err != nil { |
| 727 | return err |
| 728 | } |
| 729 | } |
| 730 | |
| 731 | // Execute assignment operations |
| 732 | if len(s.assigns) > 0 { |
| 733 | data := make(map[string]interface{}, len(s.assigns)) |
| 734 | for _, a := range s.assigns { |
| 735 | data[a.Column.Name] = a.Value |
| 736 | } |
| 737 | var r T |
| 738 | return s.c.g.apply(ctx).Model(r).Create(data).Error |
| 739 | } |
| 740 | |
| 741 | return nil |
| 742 | } |
| 743 | |
| 744 | // executeAssociationOperation executes an association operation |
| 745 | func (s setCreateOrUpdateG[T]) executeAssociationOperation(ctx context.Context, op clause.Association) error { |
nothing calls this directly
no test coverage detected