(ctx context.Context, orefs []waveobj.ORef)
| 186 | } |
| 187 | |
| 188 | func DBSelectORefs(ctx context.Context, orefs []waveobj.ORef) ([]waveobj.WaveObj, error) { |
| 189 | oidsByType := make(map[string][]string) |
| 190 | for _, oref := range orefs { |
| 191 | oidsByType[oref.OType] = append(oidsByType[oref.OType], oref.OID) |
| 192 | } |
| 193 | return WithTxRtn(ctx, func(tx *TxWrap) ([]waveobj.WaveObj, error) { |
| 194 | rtn := make([]waveobj.WaveObj, 0, len(orefs)) |
| 195 | for otype, oids := range oidsByType { |
| 196 | rtnArr, err := dbSelectOIDs(tx.Context(), otype, oids) |
| 197 | if err != nil { |
| 198 | return nil, err |
| 199 | } |
| 200 | rtn = append(rtn, rtnArr...) |
| 201 | } |
| 202 | return rtn, nil |
| 203 | }) |
| 204 | } |
| 205 | |
| 206 | func DBGetAllOIDsByType(ctx context.Context, otype string) ([]string, error) { |
| 207 | return WithTxRtn(ctx, func(tx *TxWrap) ([]string, error) { |
no test coverage detected