(ctx context.Context)
| 410 | } |
| 411 | |
| 412 | func (uc *UserCreate) sqlSave(ctx context.Context) (*User, error) { |
| 413 | if err := uc.check(); err != nil { |
| 414 | return nil, err |
| 415 | } |
| 416 | _node, _spec := uc.createSpec() |
| 417 | if err := sqlgraph.CreateNode(ctx, uc.driver, _spec); err != nil { |
| 418 | if sqlgraph.IsConstraintError(err) { |
| 419 | err = &ConstraintError{msg: err.Error(), wrap: err} |
| 420 | } |
| 421 | return nil, err |
| 422 | } |
| 423 | id := _spec.ID.Value.(int64) |
| 424 | _node.ID = int(id) |
| 425 | uc.mutation.id = &_node.ID |
| 426 | uc.mutation.done = true |
| 427 | return _node, nil |
| 428 | } |
| 429 | |
| 430 | func (uc *UserCreate) createSpec() (*User, *sqlgraph.CreateSpec) { |
| 431 | var ( |
nothing calls this directly
no test coverage detected