Filtering the list of tables in JetBrains Datagrip - datagrip

I have recently started using JetBrains DataGrip as a replacement for HeidiSQL.
My issue relates to the list of tables in the Database Explorer. We have a large database (700+ tables) and scrolling to find the table I'm looking for is rather cumbersome. For a table with a nice, long, specific name I can just start typing and get the highlighting on the table names, which usually takes me right where I need to go:
But if I'm trying to get to the table user and we have lots of other tables with "user" in the name in various positions, the highlighting tool only takes me to the first table with "user" in the name, which is not the actual "user" table (and because we have tables with names like billingUsers, it doesn't scroll to anywhere near the actual user table that I'm looking for).
What other methods should I be using when I want to find a particular table in DataGrip? In HeidiSQL, there was the "filter tables" box which would filter the list of tables based on the search term, which got me much closer to my intended destination much more quickly. Does DataGrip have any sort of "quick filter" like this? Or is there some other tool or prompt I should use to go directly to this table instead?
During the writing of this question I came across the "double Shift" shortcut, which is helpful and closer to what I'm looking for -- though in my case I have several of our development environments configured in DataGrip, and it lists the table in every environment - whereas in the Database Explorer, I usually only have one environment expanded at a time (and only want to see results from that database, not the others).
StackOverflow suggested this question to me, which has the same issue as the double-Shift shortcut -- it shows results from all databases, not just the one I'm working in.

I am from the DataGrip teram. We are currently working on that and expecting the filtering functionality in 2022.3. Anyway, now there are several workarounds (and Shift+Shift is one of them). See them here:
https://youtrack.jetbrains.com/issue/DBE-3017/Show-only-filtered-items-when-typing-in-the-database-explorer

Related

DataGrip connected to the live MariaDB does not display all the tables in the Database Explorer pane, only 15 are visible

I'm using DataGrip v 2021.3.4 of JetBrains. I connect to MariaDB hosted in AWS. The database has 28 tables, though only fifteen (15) are displayed in the Database Explorer.
Interesting thing is, I can see all the tables if I go to "show visualization":
So far this is my only workaround to get to any of the 'hidden' tables, as the visualization window allows me to right-click and select "jump to source", from there I can work on the table or switch to "edit-data" if needed:
This would be an acceptable workaround if the table names and column names were recognized and hopefully auto-populated with the DataGrip interface, but instead, I get the red-underlined table names in my .SQL with errors displayed saying that:
Unable to resolve table 'table name'
Just to clarify, executing my queries actually works and I get the expected result. The problem is that I compose my queries in the blind.
Things I've tried:
refreshing the list of tables.
disconnecting and reconnecting to the
live database.
searching for a possible solution in here, on the StackOverflow website.
Anything else you would recommend me to try?
Thank you,
Update #1 [May 1, 2022]:
Upgraded DataGrip to 2022.1.2, removed some tables, down to 21 total, still limited to 15.
Some more details, in case this becomes a question:
MacOS v11.2.3 (BigSur), 16-core Intel-based CPU, 64Gb Memory
Posting this answer in case it would save time for anyone landing on this post seeking to get answers to the same issue I was having.
DataGrip UI has two places where the list of visible tables can be filtered, and those filters are compound.
First is a main filter next to Data Explorer:
The second place is under Data Sources and Drivers -> Schemas -> Object filter options.

Determining dates of last use for tables/views in an Oracle Database

At work, my team accesses and works in a number of different databases using our team login. We have a ton of tables and views in each respective schema and I would guess that only ~10% are used regularly. As such, I would like to clean up these schemas to keep only those tables and views which are actually used and delete all the other ones (or at least archive them).
Is there any way for me to see the last time that a view was run, or the last time that a table was queried? My thinking is that if I can see that a view/table hasn't been used in x amount of time, then I'd feel more comfortable dropping it. My fear is that without such a process, I might drop tables/views that are used in Tableau dashboards and for other purposes.
Please check this Link
DBA_HIST tables can show you data depending till what date data is stored but not beyond that and it wont be conclusive.

Exclude databases from "database, table, procedure" search in DataGrip

Is there any way to limit the search for a table using Cmd+O ("database, table, procedure" search in DataGrip) to the current schema, open databases, or in some other way?
I have many databases with the same structure for different envs, and it is difficult to use the search because I need to go through the list of found tables to choose the one I'm interested in.
I am Max from DataGrip. There is no such possibility now. But we're totally agree that current implementation is inconvenient. We have been discussing this while creating our roadmap for 2018, and I hope we'll create an easy way to define various scopes in this search.

Is there any faster way to browse the DBML designer?

You know in Visual Studio when you open your .DBML and it's just this huge 2D plane full of tables? I have to scroll around and I can never find what I am looking for very quickly. I tried pressing the keyboard key of the starting letter of the tables thinking I may be able to jump around, no luck. There ought to be a drop down list at the top of table names so I can just hop to them. I literally just scrolled around for like 5 minutes and I still haven't found the table I am looking for even though I know it is there. That's when I decided to ask this question. (This has got to be one of the all time worst ideas for an interface.)
I will assume this is a question and not just a rant. Is there a way to search the designer file to find a specific table? No, there isn't.
The best way I know to manage this is to use multiple DBML files, each containing one logical group of associated tables. If you put all tables from your database into one DBML file, it will be difficult to manage and navigate.

Eliminate sort order on Data tab of SQL Developer table view

In Oracle SQL Developer, one can list the data in a table using the Data tab when viewing a table. There is also a 'Sort...' button to set the sort order of the data you are viewing. This can be very handy for viewing some data on the fly.
The problem: I set a sort order for viewing a particular table which is not supported by the indexes on that table. It seems that SQL Developer does the sort on the fly when you go to view that data. At first the delay wasn't too bad. But the table has grown and now it takes forever. There is no way to stop it except by force quitting SQL Developer, losing anything unsaved. (If you know another way to stop this sort, let me know!) So, I should change the viewing sort order to something else, but you can only access the Sort... button when viewing the data.
Is there another way to delete the viewing sort order besides viewing the data?
Where does SQL Developer store this information?
Any way to stop the sorting of the data after clicking on the data tab while waiting for it to appear?
Easy to fix (at least in v1.5.5, which is what I'm using). There's a prefs option to reset it, read about it here:
https://forums.oracle.com/forums/thread.jspa?threadID=860431
Go to Tools > Preferences > Database > ObjectViewer Parameters and select the Clear button. This will clear the sort settings.
I haven't found a command from the GUI to eliminate the sort order but you can use this workaround:
Go in the sqldeveloper settings folder. On M$ Windows is located in %HOME_USER%/Application Data/SQL Developer
Perform a full text search specifying the name of the sorted column. If the column's name is too common (ex: data) specify another column with a different name in the same table. You will find one or more xml files matching your searching criteria. Those files are table descriptors.
At the end of the xml descriptor search for the taf element with name 'orderByClause'. If it contains the name of the column you want eliminate from sorting replace the line with an empty element ()
Restart sqldeveloper and ... sort is not there anymore!
Hope this helps
Cheers,
Fabrizio Fortino
If you are willing to take a little risk, you can follow start by doing Fabrizio's suggestion, and then clean house as follows:
Go in the sqldeveloper settings folder. On M$ Windows is located in %HOME_USER%/Application Data/SQL Developer
Perform a search using the following mask "*tablesettings.xml".
Delete the files that were returned to you.
Restart sqldeveloper and your problem is gone.
To be safe, you might want to just move those files to a quarantine directory.
I believe there isn't currently a way, but there is a suggested enhancement not to retain the filter between sessions that you can vote on here on the SQL Developer forum
Go in the sqldeveloper settings folder. On M$ Windows is located in %HOME_USER%/Application Data/SQL Developer
On SQLDEveloper Version 3.0.03 (and up I guess) search for *GridSettings.xml
Find the file containing xml related to your table/view.
Either delete the file or remove only the lines corresponding to the columns previously deleted from the table. You need to remove lines from ; ;
You don't need to restart sqldeveloper. Just disconnecting and connectting back did it for me.

Resources