(ctx context.Context)
| 519 | } |
| 520 | |
| 521 | func (_c *AlertCreate) sqlSave(ctx context.Context) (*Alert, error) { |
| 522 | if err := _c.check(); err != nil { |
| 523 | return nil, err |
| 524 | } |
| 525 | _node, _spec := _c.createSpec() |
| 526 | if err := sqlgraph.CreateNode(ctx, _c.driver, _spec); err != nil { |
| 527 | if sqlgraph.IsConstraintError(err) { |
| 528 | err = &ConstraintError{msg: err.Error(), wrap: err} |
| 529 | } |
| 530 | return nil, err |
| 531 | } |
| 532 | id := _spec.ID.Value.(int64) |
| 533 | _node.ID = int(id) |
| 534 | _c.mutation.id = &_node.ID |
| 535 | _c.mutation.done = true |
| 536 | return _node, nil |
| 537 | } |
| 538 | |
| 539 | func (_c *AlertCreate) createSpec() (*Alert, *sqlgraph.CreateSpec) { |
| 540 | var ( |
nothing calls this directly
no test coverage detected