Remove getResultSetSchema function

This commit is contained in:
Koen Vlaswinkel
2023-11-27 13:31:02 +01:00
parent 297f5a9f67
commit 439cfcc023
2 changed files with 3 additions and 13 deletions

View File

@@ -33,17 +33,6 @@ export interface ResultSetSchema {
pagination?: PaginationInfo;
}
export function getResultSetSchema(
resultSetName: string,
resultSets: BQRSInfo,
): ResultSetSchema | undefined {
for (const schema of resultSets["result-sets"]) {
if (schema.name === resultSetName) {
return schema;
}
}
return undefined;
}
interface PaginationInfo {
"step-size": number;
offsets: number[];

View File

@@ -5,7 +5,6 @@ import {
import {
ColumnKindCode,
EntityValue,
getResultSetSchema,
ResultSetSchema,
} from "../../common/bqrs-cli-types";
import { CodeQLCliServer } from "../../codeql-cli/cli";
@@ -99,7 +98,9 @@ async function getLinksFromResults(
const localLinks: FullLocationLink[] = [];
const bqrsPath = outputDir.bqrsPath;
const info = await cli.bqrsInfo(bqrsPath);
const selectInfo = getResultSetSchema(SELECT_QUERY_NAME, info);
const selectInfo = info["result-sets"].find(
(schema) => schema.name === SELECT_QUERY_NAME,
);
if (isValidSelect(selectInfo)) {
// TODO: Page this
const allTuples = await cli.bqrsDecode(bqrsPath, SELECT_QUERY_NAME);