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

Completion from multiple databases #34

Closed
bowmanjd opened this issue Mar 10, 2022 · 4 comments
Closed

Completion from multiple databases #34

bowmanjd opened this issue Mar 10, 2022 · 4 comments
Labels
enhancement New feature or request

Comments

@bowmanjd
Copy link

I am unsure if this is a feature request, or a need for better understanding on my part... Thus far, I only get completion of table names and columns from the database specified in the connection. But when I SELECT FROM OtherDatabase.dbo.OtherTable I do not see completion suggestions.

Is this by design, or am I doing something wrong?

I am using a sqlserver connection.

If this is by design, might you consider adding this feature? Or perhaps this would be a feature added to vim-dadbod?

@ghost
Copy link

ghost commented Apr 2, 2022

It seems like there are three options: pulling in completions from all databases on a server, keeping multiple database connections to pull completions from, or switching the current database for the buffer.

The first one I think is obviously a bad idea.

The other two I think probably belong best in dadbod-ui (or maybe another small plugin that would support both dadbod and dodbod-ui?). Creating a function to switch the connection for the current buffer would probably be simple to implement though it would still require manual switching, which isn't perfect. Something like a workspace feature that could send vim-dadbod-completion multiple database connections to complete from should make completing from multiple databases seamless, but would require a good deal more work from both plugins.

@stale
Copy link

stale bot commented May 2, 2022

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stalled label May 2, 2022
@kristijanhusak kristijanhusak added the enhancement New feature or request label May 2, 2022
@stale stale bot removed the stalled label May 2, 2022
@bowmanjd
Copy link
Author

bowmanjd commented Jun 5, 2022

Sounds like this issue is best solved over at dadbod-ui.

@bowmanjd bowmanjd closed this as completed Jun 5, 2022
@fingolfin19
Copy link

Dadbod-ui already allows for multiple active connections. I think to get multiple database completion working the changes need to be made here.

  • If not using dadbod-ui, no changes.
  • If using dadbod-ui get all active database connections for the same server that the current buffer is connected to
  • Add database key to the cache
  • Query each active database connection and for each add all schemas/tables/columns etc. to the cache

Am I missing anything big?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants