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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable completion suggestion after SELECT based on the tables #98

Open
FreddieOliveira opened this issue Aug 22, 2020 · 2 comments
Open

Comments

@FreddieOliveira
Copy link

If you open the chinook db and run the following command

select artists.name,albums.title from artists,albums where artists.`ArtistId` = albums.`ArtistId`

litecli will only suggest completions for artist. and albums. after the where, but not after the select. That means, the artists.name,albums.title have to be typed characters by character without completion help.

@zzl0
Copy link
Contributor

zzl0 commented Aug 26, 2020

Thanks for the feedback. There is a simple workaround for this.

First, you type something like this:

select * from from artists, albums <cursor>

Then, you go back to delete the * and start typing the fields that you are interested:

select artists.<cursor> from from artists, albums

Now you should get the auto suggestions.

Basically, you have to tell the CLI which tables you are going to use.FROM is a good hint.

We probably could extract the tables from a partial query like below:

select artists.

You could say that the part before . is the table name, but then we have to deal with below use case:

select `artists.

@FreddieOliveira
Copy link
Author

Cool, the workaround worked, but I still think suggesting tables name for completion after typing select would be very handy.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants