Option to show only relevant databases #841

Open
opened 2026-03-04 11:07:33 -05:00 by deekerman · 7 comments
Owner

Originally created by @TobiasTDV on GitHub (Dec 23, 2024).

Is your feature request related to a problem? Please describe.
When you expand the database connection on the left sidebar, all databases installed on the selected server appear. Among them could be also databases where you have no access at all:
image

Describe the solution you'd like
There should be an option where you can select whether all databases should be displayed or only databases where you have access and can also establish a connection.
This option should be selected by default so that only the relevant databases are displayed.
I think this option makes the most sense at this point:
image

Originally created by @TobiasTDV on GitHub (Dec 23, 2024). **Is your feature request related to a problem? Please describe.** When you expand the database connection on the left sidebar, all databases installed on the selected server appear. Among them could be also databases where you have no access at all: ![image](https://github.com/user-attachments/assets/62f6053d-778c-40e9-a5b3-a617b5e5842d) **Describe the solution you'd like** There should be an option where you can select whether all databases should be displayed or only databases where you have access and can also establish a connection. This option should be selected by default so that only the relevant databases are displayed. I think this option makes the most sense at this point: ![image](https://github.com/user-attachments/assets/e9dfff6f-18ca-404d-a519-96ab2b1827be)
Author
Owner

@LonwoLonwo commented on GitHub (Dec 25, 2024):

Hello @TobiasTDV

Thanks for the feature request.

@LonwoLonwo commented on GitHub (Dec 25, 2024): Hello @TobiasTDV Thanks for the feature request.
Author
Owner

@LonwoLonwo commented on GitHub (Jan 9, 2025):

Could you please explain more your case?
https://stackoverflow.com/questions/19009488/the-server-principal-is-not-able-to-access-the-database-under-the-current-securi

where you have no access at all

Why do you not have this access? It looks like there are more problems with permissions, not as a restriction from the administrator.

@LonwoLonwo commented on GitHub (Jan 9, 2025): Could you please explain more your case? https://stackoverflow.com/questions/19009488/the-server-principal-is-not-able-to-access-the-database-under-the-current-securi > where you have no access at all Why do you not have this access? It looks like there are more problems with permissions, not as a restriction from the administrator.
Author
Owner

@TobiasTDV commented on GitHub (Jan 9, 2025):

@LonwoLonwo In my opinion, all databases that are installed on the database server are always listed.
However, my user only has access to a single database:
image
https://stackoverflow.com/questions/19009488/the-server-principal-is-not-able-to-access-the-database-under-the-current-securi

I would therefore like to have only this single database displayed in the drop-down menu. All other databases where I do not have access rights should only be displayed if the option is also clicked.

@TobiasTDV commented on GitHub (Jan 9, 2025): @LonwoLonwo In my opinion, **all** databases that are installed on the database server are always listed. However, my user only has access to a single database: ![image](https://github.com/user-attachments/assets/7d989489-94c7-4182-b253-f72ae42586a1) https://stackoverflow.com/questions/19009488/the-server-principal-is-not-able-to-access-the-database-under-the-current-securi I would therefore like to have only this single database displayed in the drop-down menu. All other databases where I do not have access rights should only be displayed if the option is also clicked.
Author
Owner

@LonwoLonwo commented on GitHub (Jan 10, 2025):

Ok. Thoughts about how we can get this information from the server?

@LonwoLonwo commented on GitHub (Jan 10, 2025): Ok. Thoughts about how we can get this information from the server?
Author
Owner

@TobiasTDV commented on GitHub (Jan 16, 2025):

Here is an example for MS SQL Server. With this query you get all databases that are installed on the server and additionally the information whether the user has access to the respective database:

SELECT 
  name, database_id, access = HAS_DBACCESS(name)
FROM sys.databases
WHERE name NOT IN ('master', 'tempdb', 'model', 'msdb');

Image

And based on this information, you can now add the option to display all or only the relevant databases (access = 1).

@LonwoLonwo Feel free to get back to me if you need more information or help with other database types.

@TobiasTDV commented on GitHub (Jan 16, 2025): Here is an example for `MS SQL Server`. With this query you get all databases that are installed on the server and additionally the information whether the user has access to the respective database: ``` SELECT name, database_id, access = HAS_DBACCESS(name) FROM sys.databases WHERE name NOT IN ('master', 'tempdb', 'model', 'msdb'); ``` ![Image](https://github.com/user-attachments/assets/b874dff6-8951-4d89-8749-8276e737e1a6) And based on this information, you can now add the option to display all or only the relevant databases (`access = 1`). @LonwoLonwo Feel free to get back to me if you need more information or help with other database types.
Author
Owner

@LonwoLonwo commented on GitHub (Jan 20, 2025):

Great, thanks!

@LonwoLonwo commented on GitHub (Jan 20, 2025): Great, thanks!
Author
Owner

@TobiasTDV commented on GitHub (Aug 4, 2025):

@LonwoLonwo Can you give me an update for this issue?

@TobiasTDV commented on GitHub (Aug 4, 2025): @LonwoLonwo Can you give me an update for this issue?
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/cloudbeaver#841
No description provided.