dbcli / mycli

A Terminal Client for MySQL with AutoCompletion and Syntax Highlighting.
http://mycli.net
Other
11.43k stars 662 forks source link

Column names with a keyword prefix? #486

Open dbolser-ebi opened 7 years ago

dbolser-ebi commented 7 years ago

I have columns with names like first_release and last_release. Note that the prefix of the column name is an SQL reserved word or a keyword. Seems like this breaks the autocomplete somehow?

Not really sure as I don't have time to debug properly. Here is my usual crappy recording: https://asciinema.org/a/KvKcDHxdNv4JKkjI92iNUmdI0

amjith commented 7 years ago

I remember this being an issue with pgcli where SQLParse library that we use will recognize that partial input as a keyword and that would break our completion. I can't remember if we fixed it on our side or sent a PR to sqlparse.

/cc @koljonen I think you had to deal with this in pgcli, do you remember how you fixed this?

koljonen commented 7 years ago

Sorry, no recollection of anything like that. It doesn't seem to me like sqlparse would be to blame though, as I don't think we should be sending them partially typed words; i.e. in this case sqlparse should only see SELECT [...] WHERE, not the half-written column name that follows. At least that's the way pgcli does it.