(ctx context.Context)
| 326 | } |
| 327 | |
| 328 | func (_c *MachineCreate) sqlSave(ctx context.Context) (*Machine, error) { |
| 329 | if err := _c.check(); err != nil { |
| 330 | return nil, err |
| 331 | } |
| 332 | _node, _spec := _c.createSpec() |
| 333 | if err := sqlgraph.CreateNode(ctx, _c.driver, _spec); err != nil { |
| 334 | if sqlgraph.IsConstraintError(err) { |
| 335 | err = &ConstraintError{msg: err.Error(), wrap: err} |
| 336 | } |
| 337 | return nil, err |
| 338 | } |
| 339 | id := _spec.ID.Value.(int64) |
| 340 | _node.ID = int(id) |
| 341 | _c.mutation.id = &_node.ID |
| 342 | _c.mutation.done = true |
| 343 | return _node, nil |
| 344 | } |
| 345 | |
| 346 | func (_c *MachineCreate) createSpec() (*Machine, *sqlgraph.CreateSpec) { |
| 347 | var ( |
nothing calls this directly
no test coverage detected