dbcli / mycli

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

Completion is inconsistent #1009

Open mytskine opened 3 years ago

mytskine commented 3 years ago

What is the current behavior:

  1. If I type select * from use, the first suggestion is user_devices and the 11th is user (with backticks for this one), then other tables like chat_users, and much later come sparse completions like survey_answers.
  2. If I type select * from cou, the first suggestion is course, then other tables like course_categories, later enrol_lti_lti2_consumer, then backup_courses.
  3. If I type select * from _cons, there is no exact match in the near 20 suggestions. I need to add an extra letter (_consu) to find the exact match enrol_lti_lti2_consumer.

What I expected:

Other grieves (I won't create an issue for each one, feel free to do so):

schmeic commented 3 years ago

I've noticed some other inconsistencies.

It seems like mycli tries to be smart about when a completion could be only an sql keyword or a column, and will only show completions for one type. For example, SELECT COUNT( seems to assume that only a column name will work here, so no completion for DISTINCT. Seems like it would be better to not be so "smart", and always show both sql keywords and column names.

Another strange one is that sometimes mycli will only show the completion for an exact match, even if there are other available completions. For example, I have a table called requirement with column called is_active. When I do this: SELECT is FROM requirement, with the cursor after the is I see completions for both is_active and IS. However, here: SELECT * FROM requirement WHERE is the completion for is only shows IS. Why show only the exact match in the second case?

I've also come across situations where I get no completion choices at all, even though there should be some.