Replies: 1 comment
-
|
Hi @zailaib ! I've converted this Issue to a Discussion since it doesn't map directly to an actionable PR. While the comments are very welcome, it is a bit confusing to say
since that isn't the case! Mycli does its best to parse the incomplete SQL statement as it is written (which is not always easy) and to complete what is appropriate for the point where the cursor is. Sometimes it does fall back to global completion. PRs to improve this are always super welcome! If you suffer from this issue:
my strong suggestion is to set the following in which might become the default in mycli 2.x. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Problem
Currently,
mycliperforms auto-completion against all possible candidates globally — keywords, table names, column names, functions, aliases — regardless of the user's current intent. In databases with hundreds of tables and thousands of columns, this leads to:job_position) but must typeSELECT ... FROM ...before table/column completion becomes usefulProposed Solution
Introduce manual completion modes (or contexts) that narrow the candidate scope:
Each mode would restrict auto-completion to a relevant subset, significantly reducing:
Alternative / Simpler Approach
If explicit mode switching is too heavy, consider a lighter-weight option:
completion_scopeconfig in.myclirc:Hotkey to toggle scopes at runtime (e.g.,
Ctrl-Tto cycle through modes).Use Case
A developer frequently switching between:
SHOW PROCESSLIST/EXPLAINALTER TABLEEach context benefits from a different, smaller set of completions.
Related Issues / Prior Art
smart_completionalready attempts keyword-aware narrowing, but still scans all schema objects.Desired Outcome
Faster, more focused auto-completion with less cognitive overhead, especially for users working with large schemas or frequently switching SQL contexts.
Beta Was this translation helpful? Give feedback.
All reactions