(ctx context.Context, oref waveobj.ORef)
| 123 | } |
| 124 | |
| 125 | func DBExistsORef(ctx context.Context, oref waveobj.ORef) (bool, error) { |
| 126 | return WithTxRtn(ctx, func(tx *TxWrap) (bool, error) { |
| 127 | table := tableNameFromOType(oref.OType) |
| 128 | query := fmt.Sprintf("SELECT oid FROM %s WHERE oid = ?", table) |
| 129 | return tx.Exists(query, oref.OID), nil |
| 130 | }) |
| 131 | } |
| 132 | |
| 133 | func DBGet[T waveobj.WaveObj](ctx context.Context, id string) (T, error) { |
| 134 | rtn, err := DBGetORef(ctx, waveobj.ORef{OType: getOTypeGen[T](), OID: id}) |
no test coverage detected