(ctx context.Context)
| 153 | } |
| 154 | |
| 155 | func (sc *SettingCreate) sqlSave(ctx context.Context) (*Setting, error) { |
| 156 | if err := sc.check(); err != nil { |
| 157 | return nil, err |
| 158 | } |
| 159 | _node, _spec := sc.createSpec() |
| 160 | if err := sqlgraph.CreateNode(ctx, sc.driver, _spec); err != nil { |
| 161 | if sqlgraph.IsConstraintError(err) { |
| 162 | err = &ConstraintError{msg: err.Error(), wrap: err} |
| 163 | } |
| 164 | return nil, err |
| 165 | } |
| 166 | id := _spec.ID.Value.(int64) |
| 167 | _node.ID = int(id) |
| 168 | sc.mutation.id = &_node.ID |
| 169 | sc.mutation.done = true |
| 170 | return _node, nil |
| 171 | } |
| 172 | |
| 173 | func (sc *SettingCreate) createSpec() (*Setting, *sqlgraph.CreateSpec) { |
| 174 | var ( |
nothing calls this directly
no test coverage detected