(ctx context.Context, otype string, oids []string)
| 167 | } |
| 168 | |
| 169 | func dbSelectOIDs(ctx context.Context, otype string, oids []string) ([]waveobj.WaveObj, error) { |
| 170 | return WithTxRtn(ctx, func(tx *TxWrap) ([]waveobj.WaveObj, error) { |
| 171 | table := tableNameFromOType(otype) |
| 172 | query := fmt.Sprintf("SELECT oid, version, data FROM %s WHERE oid IN (SELECT value FROM json_each(?))", table) |
| 173 | var rows []idDataType |
| 174 | tx.Select(&rows, query, dbutil.QuickJson(oids)) |
| 175 | rtn := make([]waveobj.WaveObj, 0, len(rows)) |
| 176 | for _, row := range rows { |
| 177 | waveObj, err := waveobj.FromJson(row.Data) |
| 178 | if err != nil { |
| 179 | return nil, err |
| 180 | } |
| 181 | waveobj.SetVersion(waveObj, row.Version) |
| 182 | rtn = append(rtn, waveObj) |
| 183 | } |
| 184 | return rtn, nil |
| 185 | }) |
| 186 | } |
| 187 | |
| 188 | func DBSelectORefs(ctx context.Context, orefs []waveobj.ORef) ([]waveobj.WaveObj, error) { |
| 189 | oidsByType := make(map[string][]string) |
no test coverage detected