(ctx context.Context)
| 253 | } |
| 254 | |
| 255 | func (nc *NodeCreate) sqlSave(ctx context.Context) (*Node, error) { |
| 256 | if err := nc.check(); err != nil { |
| 257 | return nil, err |
| 258 | } |
| 259 | _node, _spec := nc.createSpec() |
| 260 | if err := sqlgraph.CreateNode(ctx, nc.driver, _spec); err != nil { |
| 261 | if sqlgraph.IsConstraintError(err) { |
| 262 | err = &ConstraintError{msg: err.Error(), wrap: err} |
| 263 | } |
| 264 | return nil, err |
| 265 | } |
| 266 | id := _spec.ID.Value.(int64) |
| 267 | _node.ID = int(id) |
| 268 | nc.mutation.id = &_node.ID |
| 269 | nc.mutation.done = true |
| 270 | return _node, nil |
| 271 | } |
| 272 | |
| 273 | func (nc *NodeCreate) createSpec() (*Node, *sqlgraph.CreateSpec) { |
| 274 | var ( |
nothing calls this directly
no test coverage detected