feat: Add autocomplete support for table schema on SQL editor (#27329)

This commit is contained in:
Favour Ohanekwu 2023-09-25 06:09:46 +01:00 committed by GitHub
parent dd347c051f
commit 0a1c8e8374
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 1 deletions

View File

@ -1141,6 +1141,7 @@ export const getAllDatasourceTableKeys = createSelector(
tables[table.name] = "table";
table.columns.forEach((column) => {
tables[`${table.name}.${column.name}`] = column.type;
tables[`${column.name}`] = column.type;
});
}
});

View File

@ -46,7 +46,9 @@ export function getHintDetailsFromClassName(
}
}
const MAX_NUMBER_OF_SQL_HINTS = 200;
// Beyond 270 hints, the main thread task for rendering the hint tooltip becomes greater than 50ms
// 50ms is the limit beyond which a task is considered a long task
const MAX_NUMBER_OF_SQL_HINTS = 270;
export function filterCompletions(completions: Hints) {
completions.list = completions.list.slice(0, MAX_NUMBER_OF_SQL_HINTS);