(ctx context.Context)
| 187 | } |
| 188 | |
| 189 | func (mc *MetadataCreate) sqlSave(ctx context.Context) (*Metadata, error) { |
| 190 | if err := mc.check(); err != nil { |
| 191 | return nil, err |
| 192 | } |
| 193 | _node, _spec := mc.createSpec() |
| 194 | if err := sqlgraph.CreateNode(ctx, mc.driver, _spec); err != nil { |
| 195 | if sqlgraph.IsConstraintError(err) { |
| 196 | err = &ConstraintError{msg: err.Error(), wrap: err} |
| 197 | } |
| 198 | return nil, err |
| 199 | } |
| 200 | id := _spec.ID.Value.(int64) |
| 201 | _node.ID = int(id) |
| 202 | mc.mutation.id = &_node.ID |
| 203 | mc.mutation.done = true |
| 204 | return _node, nil |
| 205 | } |
| 206 | |
| 207 | func (mc *MetadataCreate) createSpec() (*Metadata, *sqlgraph.CreateSpec) { |
| 208 | var ( |
nothing calls this directly
no test coverage detected