Save creates the Node in the database.
(ctx context.Context)
| 161 | |
| 162 | // Save creates the Node in the database. |
| 163 | func (nc *NodeCreate) Save(ctx context.Context) (*Node, error) { |
| 164 | if err := nc.defaults(); err != nil { |
| 165 | return nil, err |
| 166 | } |
| 167 | return withHooks(ctx, nc.sqlSave, nc.mutation, nc.hooks) |
| 168 | } |
| 169 | |
| 170 | // SaveX calls Save and panics if Save returns an error. |
| 171 | func (nc *NodeCreate) SaveX(ctx context.Context) *Node { |