redash icon indicating copy to clipboard operation
redash copied to clipboard

Autocomplete V2

Open arikfr opened this issue 7 years ago • 1 comments

We have several issues with our autocomplete:

It has performance issues, hence we disable it for schemas with too many tokens. This happens because we pass all the tokens available to Ace for it to figure it out. It's possible we can utilize their API better and only return relevant suggestions.

It's not aware of the text context, i.e. if you started typing a word and then continue, it ignores existing text (#2329).

No support for aliases:

SELECT q.id
FROM queries q

In the above example it will not be aware that q is actually queries and won't suggest columns from it.

It's not aware of the code context, i.e. if I'm currently typing SELECT ... it makes sense to autocomplete almost anything, but if I'm typing FROM ... it should autocomplete table names or at least give them priority.

Sometimes it seems to highlight the wrong characters:

image

(note that highlighted v in the last suggestions)

Some people get annoyed by the autocomplete live behavior, but I'm not sure there is much to do about it. Maybe when the suggestions become more relevant it will be less of annoyance.


To implement 3 & 4, we need to understand the query. For this we can use this Javascript SQL parser.

We don't have to land it all together, but rather incremental improvements with each step.

arikfr avatar Nov 12 '18 13:11 arikfr

Just following up to see, if we have integrated to show column names? Point 2 from the OP.

AravindGopala avatar Dec 23 '23 17:12 AravindGopala