(ctx context.Context)
| 215 | } |
| 216 | |
| 217 | func (_c *UserCreate) sqlSave(ctx context.Context) (*User, error) { |
| 218 | if err := _c.check(); err != nil { |
| 219 | return nil, err |
| 220 | } |
| 221 | _node, _spec := _c.createSpec() |
| 222 | if err := sqlgraph.CreateNode(ctx, _c.driver, _spec); err != nil { |
| 223 | if sqlgraph.IsConstraintError(err) { |
| 224 | err = &ConstraintError{msg: err.Error(), wrap: err} |
| 225 | } |
| 226 | return nil, err |
| 227 | } |
| 228 | if _spec.ID.Value != nil { |
| 229 | if id, ok := _spec.ID.Value.(*uuid.UUID); ok { |
| 230 | _node.ID = *id |
| 231 | } else if err := _node.ID.Scan(_spec.ID.Value); err != nil { |
| 232 | return nil, err |
| 233 | } |
| 234 | } |
| 235 | _c.mutation.id = &_node.ID |
| 236 | _c.mutation.done = true |
| 237 | return _node, nil |
| 238 | } |
| 239 | |
| 240 | func (_c *UserCreate) createSpec() (*User, *sqlgraph.CreateSpec) { |
| 241 | var ( |
nothing calls this directly
no test coverage detected