Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix drivers completions #481

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

remisalmon
Copy link

Fixes #478

The drivers NewCompleter was removed from the handler between v0.18.1 and v0.19.0.
Tested locally, I had to cleanup the dependencies for go to build.

Copy link
Member

@nineinchnick nineinchnick left a comment

Choose a reason for hiding this comment

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

Thanks a lot for working on it! I found that the completer calls were moved from Open to New in 05236d1. We should figure out why, to avoid calling it twice. @kenshaw do you have more context why? Should we revert this one change?

@@ -783,6 +783,7 @@ func (h *Handler) Open(ctx context.Context, params ...string) error {
// force error/check connection
if err == nil {
if err = drivers.Ping(ctx, h.u, h.db); err == nil {
h.l.Completer(drivers.NewCompleter(ctx, h.u, h.db, readerOpts(), completer.WithConnStrings(h.connStrings())))
Copy link
Member

Choose a reason for hiding this comment

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

Add a check for h.l.Interactive() before calling this.

Copy link
Author

Choose a reason for hiding this comment

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

Done in c0940a3.

@remisalmon
Copy link
Author

Thanks a lot for working on it! I found that the completer calls were moved from Open to New in 05236d1. We should figure out why, to avoid calling it twice. @kenshaw do you have more context why? Should we revert this one change?

I was thinking to also move the drivers.NewCompleter() call to New but New is missing the context that this function needs.
I moved all completer calls back to Open in 2ad11cf to simplify a little but I can revert if you prefer?

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.

table name tab-completion not working between 0.18.x -> 0.19.x
2 participants