(ctx context.Context)
| 339 | } |
| 340 | |
| 341 | func (spc *StoragePolicyCreate) sqlSave(ctx context.Context) (*StoragePolicy, error) { |
| 342 | if err := spc.check(); err != nil { |
| 343 | return nil, err |
| 344 | } |
| 345 | _node, _spec := spc.createSpec() |
| 346 | if err := sqlgraph.CreateNode(ctx, spc.driver, _spec); err != nil { |
| 347 | if sqlgraph.IsConstraintError(err) { |
| 348 | err = &ConstraintError{msg: err.Error(), wrap: err} |
| 349 | } |
| 350 | return nil, err |
| 351 | } |
| 352 | id := _spec.ID.Value.(int64) |
| 353 | _node.ID = int(id) |
| 354 | spc.mutation.id = &_node.ID |
| 355 | spc.mutation.done = true |
| 356 | return _node, nil |
| 357 | } |
| 358 | |
| 359 | func (spc *StoragePolicyCreate) createSpec() (*StoragePolicy, *sqlgraph.CreateSpec) { |
| 360 | var ( |
nothing calls this directly
no test coverage detected