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

feat: add database exploring for mongodb #268

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

entropitor
Copy link

Fixes #104

Copy link
Owner

@kristijanhusak kristijanhusak left a comment

Choose a reason for hiding this comment

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

Thanks for the PR, and sorry for the late review!

Generally looks good, but we should consider handling connection strings that already have a db name inside, and show results differently.

@@ -208,6 +208,16 @@ let s:bigquery = {
\ 'requires_stdin': v:true,
\ }

let s:mongodb_dbs_query = '"\n" + db.adminCommand("listDatabases").databases.map(x => x.name).join("\n")'
Copy link
Owner

Choose a reason for hiding this comment

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

We need to consider the case where the database name is defined in the url, for example mongodb://localhost:27017/my_test_db.
In that situation, we should just show table names.
We already do similar thing for mysql/mariadb here. We can convert that to a hash map and consider mongodb and mongodb+srv as part of that.

I added this myself to see how it looks, and noticed that table names in drawer got db. prepended, like db.users. We can probably solve that in the schemes_tables_query somehow.

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.

switch mongo db
2 participants