(ctx context.Context, id string, updateFn func(T))
| 318 | } |
| 319 | |
| 320 | func DBUpdateFn[T waveobj.WaveObj](ctx context.Context, id string, updateFn func(T)) error { |
| 321 | return WithTx(ctx, func(tx *TxWrap) error { |
| 322 | val, err := DBMustGet[T](tx.Context(), id) |
| 323 | if err != nil { |
| 324 | return err |
| 325 | } |
| 326 | updateFn(val) |
| 327 | return DBUpdate(tx.Context(), val) |
| 328 | }) |
| 329 | } |
| 330 | |
| 331 | func DBUpdateFnErr[T waveobj.WaveObj](ctx context.Context, id string, updateFn func(T) error) error { |
| 332 | return WithTx(ctx, func(tx *TxWrap) error { |
no test coverage detected