(ctx context.Context)
| 202 | } |
| 203 | |
| 204 | func (sfc *StorageFileCreate) sqlSave(ctx context.Context) (*StorageFile, error) { |
| 205 | if err := sfc.check(); err != nil { |
| 206 | return nil, err |
| 207 | } |
| 208 | _node, _spec := sfc.createSpec() |
| 209 | if err := sqlgraph.CreateNode(ctx, sfc.driver, _spec); err != nil { |
| 210 | if sqlgraph.IsConstraintError(err) { |
| 211 | err = &ConstraintError{msg: err.Error(), wrap: err} |
| 212 | } |
| 213 | return nil, err |
| 214 | } |
| 215 | if _spec.ID.Value != nil { |
| 216 | if id, ok := _spec.ID.Value.(*uuid.UUID); ok { |
| 217 | _node.ID = *id |
| 218 | } else if err := _node.ID.Scan(_spec.ID.Value); err != nil { |
| 219 | return nil, err |
| 220 | } |
| 221 | } |
| 222 | sfc.mutation.id = &_node.ID |
| 223 | sfc.mutation.done = true |
| 224 | return _node, nil |
| 225 | } |
| 226 | |
| 227 | func (sfc *StorageFileCreate) createSpec() (*StorageFile, *sqlgraph.CreateSpec) { |
| 228 | var ( |
nothing calls this directly
no test coverage detected