Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add dot behavior to autocomplete #3092

merged 9 commits into from Dec 26, 2018


Copy link

commented Nov 18, 2018


A start on #3067 - Issues 1 and 2.
This changes the dot behavior when writing a query and start separating keyword types as Table Keyword, Column Keyword or Table-column Keyword

With that we separate 2 situations of autocomplete, instead of rendering the entire schema:

  1. Default - Show table and distinct column names;
  2. tableName. - Show specific Table columns.

This will probably improve the performance and be useful when we introduce aliases or query context.


Autocomplete not aware of the context (#3067 and #2329)

The dot by default breaks autocomplete words, so I changed its Regexp to include it.

Repeated suggestions when navigating through query pages

This seems to be something that could be affecting the performance.
Whenever would one navigate to a new query page, another completer would be added to langTools. I've changed addCompleter to setCompleters to fix this.






To do

  • Start it
  • Test changes with a large schema and validate the performance
  • Refactor QueryEditor constructor
  • Refactor other QueryEditor methods? 馃

We'll probably have some conflicts with #3091, but nothing huge.

Let me know your thoughts 馃榿

@gabrieldutra gabrieldutra self-assigned this Nov 18, 2018

gabrieldutra added some commits Nov 22, 2018

this.onLoad = (editor) => {

This comment has been minimized.

Copy link

gabrieldutra Nov 25, 2018

Author Member

Was there a reason for those methods to be inside QueryEditor's constructor?

This comment has been minimized.

Copy link

arikfr Nov 25, 2018



@washort ?


This comment has been minimized.

Copy link
Member Author

commented Nov 25, 2018

Well, I tested with a db schema with 10k tokensCount (twice the current limit of 5k) and I actually didn't have any performance issues neither before nor after these PR changes. I did notice a good change on the suggestions, but it's probably better to wait for other improvements before disabling the tokensCount rule.

LMK what you think 馃榿

@gabrieldutra gabrieldutra changed the title WIP: Add dot behavior to autocomplete Add dot behavior to autocomplete Nov 25, 2018

gabrieldutra added some commits Nov 26, 2018

@arikfr arikfr added the review label Dec 17, 2018

@ghost ghost assigned arikfr Dec 26, 2018

@arikfr arikfr merged commit 26965b4 into getredash:master Dec 26, 2018

9 of 11 checks passed

Header rules No header rules processed
Pages changed 11 new files uploaded
Mixed content No mixed content detected
Redirect rules 7 redirect rules processed
WIP Ready for review
build Workflow: build
codeclimate 1 fixed issue
deploy/netlify Deploy preview ready!
percy/redash Visual review automatically approved, no visual changes found.
security/snyk - package.json (arikfr) No new issues
security/snyk - requirements.txt (arikfr) No manifest changes detected

@ghost ghost removed the review label Dec 26, 2018


This comment has been minimized.

Copy link

commented Dec 26, 2018


Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
2 participants
You can鈥檛 perform that action at this time.