(ctx context.Context)
| 190 | } |
| 191 | |
| 192 | func (sfu *StorageFileUpdate) sqlSave(ctx context.Context) (n int, err error) { |
| 193 | if err := sfu.check(); err != nil { |
| 194 | return n, err |
| 195 | } |
| 196 | _spec := sqlgraph.NewUpdateSpec(storagefile.Table, storagefile.Columns, sqlgraph.NewFieldSpec(storagefile.FieldID, field.TypeUUID)) |
| 197 | if ps := sfu.mutation.predicates; len(ps) > 0 { |
| 198 | _spec.Predicate = func(selector *sql.Selector) { |
| 199 | for i := range ps { |
| 200 | ps[i](selector) |
| 201 | } |
| 202 | } |
| 203 | } |
| 204 | if value, ok := sfu.mutation.UpdateTime(); ok { |
| 205 | _spec.SetField(storagefile.FieldUpdateTime, field.TypeTime, value) |
| 206 | } |
| 207 | if value, ok := sfu.mutation.BucketName(); ok { |
| 208 | _spec.SetField(storagefile.FieldBucketName, field.TypeString, value) |
| 209 | } |
| 210 | if value, ok := sfu.mutation.ObjectName(); ok { |
| 211 | _spec.SetField(storagefile.FieldObjectName, field.TypeString, value) |
| 212 | } |
| 213 | if sfu.mutation.ObjectNameCleared() { |
| 214 | _spec.ClearField(storagefile.FieldObjectName, field.TypeString) |
| 215 | } |
| 216 | if value, ok := sfu.mutation.FilePath(); ok { |
| 217 | _spec.SetField(storagefile.FieldFilePath, field.TypeString, value) |
| 218 | } |
| 219 | if value, ok := sfu.mutation.FileType(); ok { |
| 220 | _spec.SetField(storagefile.FieldFileType, field.TypeString, value) |
| 221 | } |
| 222 | if value, ok := sfu.mutation.FileURL(); ok { |
| 223 | _spec.SetField(storagefile.FieldFileURL, field.TypeString, value) |
| 224 | } |
| 225 | if sfu.mutation.FileURLCleared() { |
| 226 | _spec.ClearField(storagefile.FieldFileURL, field.TypeString) |
| 227 | } |
| 228 | _spec.AddModifiers(sfu.modifiers...) |
| 229 | if n, err = sqlgraph.UpdateNodes(ctx, sfu.driver, _spec); err != nil { |
| 230 | if _, ok := err.(*sqlgraph.NotFoundError); ok { |
| 231 | err = &NotFoundError{storagefile.Label} |
| 232 | } else if sqlgraph.IsConstraintError(err) { |
| 233 | err = &ConstraintError{msg: err.Error(), wrap: err} |
| 234 | } |
| 235 | return 0, err |
| 236 | } |
| 237 | sfu.mutation.done = true |
| 238 | return n, nil |
| 239 | } |
| 240 | |
| 241 | // StorageFileUpdateOne is the builder for updating a single StorageFile entity. |
| 242 | type StorageFileUpdateOne struct { |
nothing calls this directly
no test coverage detected