FieldValues: Use plain arrays instead of Vector (part 3 of 2) (#66612)

Co-authored-by: Ryan McKinley <ryantxu@gmail.com>
This commit is contained in:
Leon Sorokin
2023-04-20 09:59:18 -05:00
committed by GitHub
parent 24696d593b
commit b24ba7b7ae
109 changed files with 594 additions and 648 deletions

View File

@@ -23,13 +23,13 @@ export class MssqlDatasource extends SqlDatasource {
async fetchDatasets(): Promise<string[]> {
const datasets = await this.runSql<{ name: string[] }>(showDatabases(), { refId: 'datasets' });
return datasets.fields.name?.values.toArray().flat() ?? [];
return datasets.fields.name?.values.flat() ?? [];
}
async fetchTables(dataset?: string): Promise<string[]> {
// We get back the table name with the schema as well. like dbo.table
const tables = await this.runSql<{ schemaAndName: string[] }>(getSchemaAndName(dataset), { refId: 'tables' });
return tables.fields.schemaAndName?.values.toArray().flat() ?? [];
return tables.fields.schemaAndName?.values.flat() ?? [];
}
async fetchFields(query: SQLQuery): Promise<SQLSelectableValue[]> {
@@ -42,8 +42,8 @@ export class MssqlDatasource extends SqlDatasource {
});
const result: SQLSelectableValue[] = [];
for (let i = 0; i < schema.length; i++) {
const column = schema.fields.column.values.get(i);
const type = schema.fields.type.values.get(i);
const column = schema.fields.column.values[i];
const type = schema.fields.type.values[i];
result.push({ label: column, value: column, type, icon: getIcon(type), raqbFieldType: getRAQBType(type) });
}
return result;