mtxr / vscode-sqltools

Database management for VSCode
https://vscode-sqltools.mteixeira.dev?utm_source=github&utm_medium=homepage-link
MIT License
1.48k stars 296 forks source link

MSSQL connection shows other databases at top level. #714

Open mikes-gh opened 3 years ago

mikes-gh commented 3 years ago

Describe the bug Connecting to a specific database using the MSSQL driver shows all the other databases on the server. Theses unwanted nodes contain an empty schema node and just take up screen space.

Expected behavior Just show the database supplied in the connection properties.

Screenshots image

Desktop (please complete the following information):

gjsjohnmurray commented 2 years ago

This may have been intentional as a way for the user to discover all the databases they have access to. In PR #938 I am taking a different approach for the MySQL driver, promoting the database specified in the connection to the top of the list. That PR also allows the user to access one of the the meta-databases by naming it in the connection spec.

@mikes-gh @bherbruck do you think that approach will be acceptable for MSSQL too?

mtxr commented 2 years ago

@gjsjohnmurray most of the DB tools I see they list all databases. The idea of having a target database is meant just for having default queries targeting that database, that doesnt mean the database should not be seen,

In this case, I liked your proposal on #938 . I believe the majority of the users uses other DBs eventually.

In this scenario, since you will display the target DB at the top, I believe it's a good solution for this issue. Anything other than that I would point to group on "other databases" and have it all there, but that could have other implications on the current existing flow of the tool...

xenago commented 1 year ago

I think like most other tools (SSMS, DBeaver, etc) all of the connection's accessible databases should be usable, with the user able to select which one from the active connection is used. If that is not possible then these other inaccessible databases should be hidden or otherwise indicated to be unusable, since it makes for a very confusing UI. The proposal in #938 seems close to this which is a good idea

fzhem commented 3 months ago

I have created a fork of the mssql extension that allows you to display empty dbs/schemas. These options are currently experimental. Here's the link to the extension: https://marketplace.visualstudio.com/items?itemName=fzhem.sqltools-driver-mssql-commver