litecli
litecli copied to clipboard
Enable completion suggestion after SELECT based on the tables
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.
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.
Cool, the workaround worked, but I still think suggesting tables name for completion after typing select
would be very handy.