Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Keyword additions#1

Merged
amjith merged 1 commit intodbcli:masterfrom
j-bennet:master
Dec 18, 2014
Merged

Keyword additions#1
amjith merged 1 commit intodbcli:masterfrom
j-bennet:master

Conversation

@j-bennet
Copy link
Contributor

added support for ansi sql functions
added CASE, WHEN, FULL keywords
changed GROUP to GROUP BY

@j-bennet
Copy link
Contributor Author

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.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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?

@amjith
Copy link
Member

amjith commented Dec 18, 2014

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.

amjith added a commit that referenced this pull request Dec 18, 2014
@amjith amjith merged commit 01fc25f into dbcli:master Dec 18, 2014
@amjith
Copy link
Member

amjith commented Dec 18, 2014

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.

@j-bennet
Copy link
Contributor Author

Ok! I'll take another look tomorrow.
On Dec 17, 2014 10:31 PM, "Amjith Ramanujam" [email protected]
wrote:

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.


Reply to this email directly or view it on GitHub
#1 (comment).

amjith pushed a commit that referenced this pull request Aug 1, 2016
Tabulate: correct alignment when missingval contains a color code
koljonen added a commit to koljonen/pgcli that referenced this pull request Dec 11, 2016
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.
koljonen added a commit to koljonen/pgcli that referenced this pull request Dec 12, 2016
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.
koljonen added a commit to koljonen/pgcli that referenced this pull request Dec 12, 2016
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.
koljonen added a commit to koljonen/pgcli that referenced this pull request Dec 12, 2016
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.
koljonen added a commit to koljonen/pgcli that referenced this pull request Mar 5, 2017
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

Successfully merging this pull request may close these issues.

3 participants