(ctx context.Context, id string)
| 136 | } |
| 137 | |
| 138 | func DBMustGet[T waveobj.WaveObj](ctx context.Context, id string) (T, error) { |
| 139 | rtn, err := DBGetORef(ctx, waveobj.ORef{OType: getOTypeGen[T](), OID: id}) |
| 140 | if err != nil { |
| 141 | var zeroVal T |
| 142 | return zeroVal, err |
| 143 | } |
| 144 | if rtn == nil { |
| 145 | var zeroVal T |
| 146 | return zeroVal, ErrNotFound |
| 147 | } |
| 148 | return rtn.(T), nil |
| 149 | } |
| 150 | |
| 151 | func DBGetORef(ctx context.Context, oref waveobj.ORef) (waveobj.WaveObj, error) { |
| 152 | return WithTxRtn(ctx, func(tx *TxWrap) (waveobj.WaveObj, error) { |
no test coverage detected