See all databases on a connection without having to reconfigure?

In our application each customer has it's own database.
Depending on what customers I'm working for I restore that customer's database on localhost.
So depending on the day I have a different set of databases on a fixed connection (localhost).

Is there a way to navigate between databases for a certain connection?
Basically an alternative for SSMS's Object Explorer.

7 comments
Comment actions Permalink

Hello Boris,

In the connection url string to the server with multiply databases, please omit specific database name. Then please select needed databases and schemas in Shemas tab https://www.jetbrains.com/datagrip/help/data-sources-and-drivers-dialog.html#schemasAndTablesTab of the created Datasource.

Does it help?

0
Comment actions Permalink

Hey Andrey,

We have some 400+ customers with each their own database.
Lumping those together would be highly impractical.

Furthermore when I work on localhost I typically drop my customers daily and load backups for the ones I have to work for today. 
Altering the filter every day would also become old, really quickly.

0
Comment actions Permalink

What approach do you use with SSMS's Object Explorer? DataGrip will display the databases in Database Tool Window for the connection, where you can use speed search for searching certain database:

>Depending on what customers I'm working for I restore that customer's database on localhost.
>So depending on the day I have a different set of databases on a fixed connection (localhost).

If you have changed database object/schema or added new database for the connection outside of DataGrip, invoke Synchronize action in Database Tool Window, in order to DataGrip to synchronize the change.

0
Comment actions Permalink

Hey Andrey,

Thanks for your swift response.
I didn't know they were grouped by DB, thought I checked that out earlier but must have mucked that up.
As of now I'll be selecting schema's daily depending on what client I'll be working on. It's workable, but not a very pleasant experience.

In SSMS I enter the connection (without db) and it lists all the databases in there by default. From there I would select the DB from the list and get going.
For doing the same in Datagrip I have to select all the schema's on the connection first. There are several thousands of schema's (#clients times their individual schemas) and no way to multi select, search or do mass operations on the list.
I tried selecting the first 10 Databases (databaseName.* schemas) but DG threw an Out Of Memory dialogue at me where I could increase the max memory.

It's not that I want an exact replica of SSMS. I'm just looking for a way to manage hundreds of databases on a single connection.
As all the databases I need start with a fixed prefix, the Object filter would be the perfect solution to my problem, but I don't think I can make a filter on DB name there. That would be a superior experience then my existing tools as that way I also hide the irrelevant DBs.
Furthermore I would also need some way to analyse the schema's only for the one(s) I'm currently working on as otherwise I'm going to run out of resources pretty quickly I fear.

 

1
Comment actions Permalink

Thank you for your feedback. I've created a request to think about better way of organizing such connections. Please vote and follow it in YouTrack: https://youtrack.jetbrains.com/issue/DBE-2427 .

>For doing the same in Datagrip I have to select all the schema's on the connection first. There are several thousands of schema's (#clients times their individual schemas) and no way to multi select, search or do mass operations on the list.

Please vote for related request: https://youtrack.jetbrains.com/issue/DBE-2042 .

0
Comment actions Permalink

>I tried selecting the first 10 Databases (databaseName.* schemas) but DG threw an Out Of Memory dialogue at me where I could increase the max memory.

Btw as a possible workaround top avoid OOM errors when synchronizing all the databases you could create new project for each set of pre-selected databases and reopen it, when needed.

0
Comment actions Permalink

This does not seem to work in pycharm 2017.1 with postgres db. If I leave the db empty, it tries to connect to a db with the same name as user instead of loading all dbs.

2

Please sign in to leave a comment.