(ctx context.Context)
| 361 | } |
| 362 | |
| 363 | func (fc *FileCreate) sqlSave(ctx context.Context) (*File, error) { |
| 364 | if err := fc.check(); err != nil { |
| 365 | return nil, err |
| 366 | } |
| 367 | _node, _spec := fc.createSpec() |
| 368 | if err := sqlgraph.CreateNode(ctx, fc.driver, _spec); err != nil { |
| 369 | if sqlgraph.IsConstraintError(err) { |
| 370 | err = &ConstraintError{msg: err.Error(), wrap: err} |
| 371 | } |
| 372 | return nil, err |
| 373 | } |
| 374 | id := _spec.ID.Value.(int64) |
| 375 | _node.ID = int(id) |
| 376 | fc.mutation.id = &_node.ID |
| 377 | fc.mutation.done = true |
| 378 | return _node, nil |
| 379 | } |
| 380 | |
| 381 | func (fc *FileCreate) createSpec() (*File, *sqlgraph.CreateSpec) { |
| 382 | var ( |
nothing calls this directly
no test coverage detected