Conversation
…; changed GROUP to GROUP BY
|
I was going to add SQL functions into the whole keywords mix, but decided they better be their own separate group. They are mostly used after SELECT, WHERE and HAVING, but rarely after ORDER BY and GROUP BY. |
There was a problem hiding this comment.
I just checked this change locally and realized that there is a mistake in the completion. The last_token will always be 'by' so when I check if it's 'order by' or 'group by' it will never match. So the completions for those will always end up in the 'else' clause which results in showing all the keywords, instead of columns.
The fix for that is to check if last_token.lower() in ('set', 'by'):
That should fix it. Would you mind updating the PR with that change as well?
|
Thank you for the PR. Everything looks good. I'm happy with the separation of functions. If you can update the PR as per the comment above, I'll be happy to merge it in. |
|
I decided to merge it now, since I'm making some changes to the sqlcompletion.py file and I didn't want it to have a bunch of conflicts the next time you try to make a PR. |
|
Ok! I'll take another look tomorrow.
|
Tabulate: correct alignment when missingval contains a color code
E.g. for table `Foo` with columns `FooBar` and `Fabulous`, inputting `SELECT * FROM Foo F WHERE F.fb` will suggest `FooBar` as the dbcli#1 choice. Likewise, given the functions `baz_baz()` and `baab()`, inputting `SELECT bb` will have `baz_baz()` as the first option.
E.g. for table `Foo` with columns `FooBar` and `Fabulous`, inputting `SELECT * FROM Foo F WHERE F.fb` will suggest `FooBar` as the dbcli#1 choice. Likewise, given the functions `baz_baz()` and `baab()`, inputting `SELECT bb` will have `baz_baz()` as the first option.
E.g. for table `Foo` with columns `FooBar` and `Fabulous`, inputting `SELECT * FROM Foo F WHERE F.fb` will suggest `FooBar` as the dbcli#1 choice. Likewise, given the functions `baz_baz()` and `baab()`, inputting `SELECT bb` will have `baz_baz()` as the first option.
E.g. for table `Foo` with columns `FooBar` and `Fabulous`, inputting `SELECT * FROM Foo F WHERE F.fb` will suggest `FooBar` as the dbcli#1 choice. Likewise, given the functions `baz_baz()` and `baab()`, inputting `SELECT bb` will have `baz_baz()` as the first option.
added support for ansi sql functions
added CASE, WHEN, FULL keywords
changed GROUP to GROUP BY