(ctx context.Context)
| 213 | } |
| 214 | |
| 215 | func (_u *AlertUpdate) sqlSave(ctx context.Context) (_node int, err error) { |
| 216 | _spec := sqlgraph.NewUpdateSpec(alert.Table, alert.Columns, sqlgraph.NewFieldSpec(alert.FieldID, field.TypeInt)) |
| 217 | if ps := _u.mutation.predicates; len(ps) > 0 { |
| 218 | _spec.Predicate = func(selector *sql.Selector) { |
| 219 | for i := range ps { |
| 220 | ps[i](selector) |
| 221 | } |
| 222 | } |
| 223 | } |
| 224 | if value, ok := _u.mutation.UpdatedAt(); ok { |
| 225 | _spec.SetField(alert.FieldUpdatedAt, field.TypeTime, value) |
| 226 | } |
| 227 | if _u.mutation.BucketIdCleared() { |
| 228 | _spec.ClearField(alert.FieldBucketId, field.TypeString) |
| 229 | } |
| 230 | if _u.mutation.MessageCleared() { |
| 231 | _spec.ClearField(alert.FieldMessage, field.TypeString) |
| 232 | } |
| 233 | if _u.mutation.EventsCountCleared() { |
| 234 | _spec.ClearField(alert.FieldEventsCount, field.TypeInt32) |
| 235 | } |
| 236 | if _u.mutation.StartedAtCleared() { |
| 237 | _spec.ClearField(alert.FieldStartedAt, field.TypeTime) |
| 238 | } |
| 239 | if _u.mutation.StoppedAtCleared() { |
| 240 | _spec.ClearField(alert.FieldStoppedAt, field.TypeTime) |
| 241 | } |
| 242 | if _u.mutation.SourceIpCleared() { |
| 243 | _spec.ClearField(alert.FieldSourceIp, field.TypeString) |
| 244 | } |
| 245 | if _u.mutation.SourceRangeCleared() { |
| 246 | _spec.ClearField(alert.FieldSourceRange, field.TypeString) |
| 247 | } |
| 248 | if _u.mutation.SourceAsNumberCleared() { |
| 249 | _spec.ClearField(alert.FieldSourceAsNumber, field.TypeString) |
| 250 | } |
| 251 | if _u.mutation.SourceAsNameCleared() { |
| 252 | _spec.ClearField(alert.FieldSourceAsName, field.TypeString) |
| 253 | } |
| 254 | if _u.mutation.SourceCountryCleared() { |
| 255 | _spec.ClearField(alert.FieldSourceCountry, field.TypeString) |
| 256 | } |
| 257 | if _u.mutation.SourceLatitudeCleared() { |
| 258 | _spec.ClearField(alert.FieldSourceLatitude, field.TypeFloat32) |
| 259 | } |
| 260 | if _u.mutation.SourceLongitudeCleared() { |
| 261 | _spec.ClearField(alert.FieldSourceLongitude, field.TypeFloat32) |
| 262 | } |
| 263 | if _u.mutation.SourceScopeCleared() { |
| 264 | _spec.ClearField(alert.FieldSourceScope, field.TypeString) |
| 265 | } |
| 266 | if _u.mutation.SourceValueCleared() { |
| 267 | _spec.ClearField(alert.FieldSourceValue, field.TypeString) |
| 268 | } |
| 269 | if _u.mutation.CapacityCleared() { |
| 270 | _spec.ClearField(alert.FieldCapacity, field.TypeInt32) |
| 271 | } |
| 272 | if _u.mutation.LeakSpeedCleared() { |
nothing calls this directly
no test coverage detected