-
Notifications
You must be signed in to change notification settings - Fork 1
Description
First of all, thank you for such a powerful tool!
I am excited to use sqlynx to provide autocomplete features within our browser-based code editor.
However, I've encountered some limitations, particularly when it comes to efficiently handling databases with a large number of tables. Currently, the tool requires an external script containing SQL instructions (e.g., CREATE TABLE) for accurate hints.
The issue arises in terms of performance, especially with databases containing thousands of tables. Parsing this script for schema information impacts performance by freezing the page for several seconds.
It would be nice to have additional API methods that allow direct updates to the completion index with new identifiers. Ideally, these changes could look like:
interface Schema {
tables: {
tableName: string;
columns: string[];
}[];
}
getSchema(): Schema
addTable(tableName: string, columns: string[]): Schema
removeTable(tableName: string): SchemaWith packing data into corresponding flatbuffers structure.
Here's a bit of context regarding our usage scenarios:
- During document initialization, we get
analyzedScript.tableReferencesandanalyzedScript.columnReferences, searching for matches within our internal storage and updating the schema. - Similarly, while users type text, we continuously check for new table and column identifiers and update the schema.
- When executing a DROP TABLE statement, we remove the table from the schema.
Implementing these changes would significantly enhance performance, especially in scenarios with massive database schemas.
Thank you for considering these changes!