(ctx context.Context)
| 274 | } |
| 275 | |
| 276 | func (ec *EntityCreate) sqlSave(ctx context.Context) (*Entity, error) { |
| 277 | if err := ec.check(); err != nil { |
| 278 | return nil, err |
| 279 | } |
| 280 | _node, _spec := ec.createSpec() |
| 281 | if err := sqlgraph.CreateNode(ctx, ec.driver, _spec); err != nil { |
| 282 | if sqlgraph.IsConstraintError(err) { |
| 283 | err = &ConstraintError{msg: err.Error(), wrap: err} |
| 284 | } |
| 285 | return nil, err |
| 286 | } |
| 287 | id := _spec.ID.Value.(int64) |
| 288 | _node.ID = int(id) |
| 289 | ec.mutation.id = &_node.ID |
| 290 | ec.mutation.done = true |
| 291 | return _node, nil |
| 292 | } |
| 293 | |
| 294 | func (ec *EntityCreate) createSpec() (*Entity, *sqlgraph.CreateSpec) { |
| 295 | var ( |
nothing calls this directly
no test coverage detected