This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 202833 - add ability to filter the listed database/schemas in the Databases node
Summary: add ability to filter the listed database/schemas in the Databases node
Status: VERIFIED FIXED
Alias: None
Product: db
Classification: Unclassified
Component: Code (show other bugs)
Version: 7.1
Hardware: All All
: P3 normal (vote)
Assignee: Jaroslav Havlin
URL:
Keywords: NETFIX
: 64167 153622 179346 218135 219153 (view as bug list)
Depends on:
Blocks:
 
Reported: 2011-09-29 16:04 UTC by athompson
Modified: 2013-05-13 19:04 UTC (History)
6 users (show)

See Also:
Issue Type: ENHANCEMENT
Exception Reporter:


Attachments
node shows all DBs/schemas (56.08 KB, image/png)
2011-09-29 16:04 UTC, athompson
Details
Proposed Patch - not finished (17.80 KB, application/octet-stream)
2013-02-15 15:49 UTC, Jaroslav Havlin
Details
Screenshot - DB Explorer with "Other schemas" node (24.38 KB, image/png)
2013-02-15 15:50 UTC, Jaroslav Havlin
Details
proposed patch v2 (based on 131431: Proposed Patch - not finished) (33.85 KB, patch)
2013-02-15 21:51 UTC, matthias42
Details | Diff
proposed patch v3 (based on 131431: Proposed Patch - not finished) (40.84 KB, patch)
2013-02-16 13:21 UTC, matthias42
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description athompson 2011-09-29 16:04:09 UTC
Created attachment 111322 [details]
node shows all DBs/schemas

When creating a new database connection in NB for SQL server (and others), you specify what DB you want to connect to and what schema to use.  However, when the connection node is open, you still have to find and open the previously-specified DB (true, it's in bold) and then find and open the previously-specified schema.  This is a waste of time and clicks because 99% of the time you want the DB and schema when you created the connection, and a big waste of UI real-estate listing all those other DBs and schemas.  See picture.

How about instead showing just the specified schema?  So directly under the root node (research-dev in the picture), show the "Tables", "Views", and "Procedures" nodes which is all the user wants to see 99% of the time.  In the root node's context menu, you can add a "Show All Databases/Schemas" button, which would revert to the current layout if needed.

This applies to other DB connection types as well.  For example, with javaDB you almost never need to use all those system DBs so why show them?
Comment 1 Jiri Rechtacek 2011-10-03 04:16:59 UTC
I understand your point of view but it's right opposite of RFE show all available schemas which an db user is granted to select (I don't remember the number of that issue, but it was in plan for some previous release, reviewed by UI team that time and deliver in NB6.5 I guess. I was not a member of DB team that time so I don't know more details.). So I think it is a candidate for review UI again and should be tracked as RFE. Thanks for your feedback anyway.
Comment 2 athompson 2011-10-04 14:58:43 UTC
Yup, I'm not saying that NB shouldn't show all available schemas and DBs--they should just be hidden by default, and shown through the context menu or something similar.  That should make both camps happy.
Comment 3 matthias42 2012-08-10 19:42:55 UTC
*** Bug 179346 has been marked as a duplicate of this bug. ***
Comment 4 matthias42 2012-08-10 19:48:20 UTC
This needs to be configurable. There is the group that works regularly across different schemas and databases (count me to that group). This groups needs to see alls dbs and all schemas in these dbs. The other groups mostly/only works in one db in one schema - for these the information about the other databases/schemas on the server is useless.

Before now someone decides filtering is a good idea by default, keep in mind, that the second group can work with the current situation, while the first group can't work around a potentially filtered list.
Comment 5 athompson 2012-08-10 20:51:36 UTC
Yup, I addressed that in comment #2--just hide them by default and expose them on demand.  Another possibility is to just create a new connection for each schema you want to work with...
Comment 6 matthias42 2012-09-11 18:20:09 UTC
*** Bug 218135 has been marked as a duplicate of this bug. ***
Comment 7 matthias42 2012-09-29 20:41:45 UTC
*** Bug 219153 has been marked as a duplicate of this bug. ***
Comment 8 matthias42 2012-09-29 20:42:56 UTC
Summary from 219153: The schema list should be groupable.
Comment 9 marcincinik 2012-11-26 07:46:07 UTC
Apparently the alternative "to just create a new connection for each
schema you want to work with" is not applicable to Oracle. Probably is neither applicable for other databases too.
Comment 10 marcincinik 2012-11-26 07:46:33 UTC
Apparently the alternative "to just create a new connection for each
schema you want to work with" is not applicable to Oracle. Probably is neither applicable for other databases too.
Comment 11 matthias42 2013-02-14 20:31:54 UTC
*** Bug 64167 has been marked as a duplicate of this bug. ***
Comment 12 matthias42 2013-02-14 20:32:48 UTC
(In reply to comment #11)
> *** Bug 64167 has been marked as a duplicate of this bug. ***

Summary from #64167: Add ability to filter tablelist by regular expressions.
Comment 13 entonio 2013-02-14 20:55:13 UTC
I can't believe this bug is still around. It's been ages since I reported what must have become a duplicate of this. Yes, it's a bug, not a RFE. If you select a certain schema as the one to use and then the software simply ignores that selection, that's a bug. And it never used to behave that way. It's all very well to come up with a new UI which lets you switch between 

- show all
- show some (checkboxes? With 'All' and 'None' options? I think that's the only thing needed, how hard can it be?)
- filter (can't be the only way to show only 'the' selected scheme, it makes no sense to have to filter every time)

but until that's in place this is an ugly bug. So ugly in fact that folks simply stopped using NB for this purpose. I know I did and a lot of other people too. It takes me more effort to wade through the dozens of schemas every single time that I need one of them, than to fire up SQLDeveloper or something like that. Which I didn't do before, when the DB viewer in NB worked the way it is expected to work.

Sorry for the tone but this really bothers me. Even a single small note in the connection wizard explaining why this has been done would have been enough, but we've not even had that.
Comment 14 Jaroslav Havlin 2013-02-15 15:49:40 UTC
Created attachment 131431 [details]
Proposed Patch - not finished

What about adding node "Other schemas",  plus some action to mark important schemas that should be displayed besides the default schema?
Comment 15 Jaroslav Havlin 2013-02-15 15:50:34 UTC
Created attachment 131432 [details]
Screenshot - DB Explorer with "Other schemas" node
Comment 16 matthias42 2013-02-15 21:51:43 UTC
Created attachment 131440 [details]
proposed patch v2 (based on  131431: Proposed Patch - not finished)

Sorry - could not resist :-) - the not finished part also applies here.

Changes I made:

1. Add same filtering ability to catalogs
2. Make sure the "Other schema/catalog" nodes are sorted last
3. Add ability to ToggleAction to work on multiple nodes


I tested with informix and metadata retrieval is dog slow. This motivated me to work on 3 - It should be considered not to invalidate the metadata, as it is not changed, but only the structural side.
Comment 17 matthias42 2013-02-16 13:21:46 UTC
Created attachment 131453 [details]
proposed patch v3 (based on 131431: Proposed Patch - not finished)

Changes v2->v3:

- Change name in DatabaseConnection from importantDatabases to importantCatalogs
- Use (Weak) PropertyChangeListener to rebuild the node tree (without refetching DB metadata)
- Switch to Sets to hold "important databases" and "important" schemas
Comment 18 Jaroslav Havlin 2013-02-18 10:46:16 UTC
Wow, great job, thank you very much!

Applied as http://hg.netbeans.org/core-main/rev/268ae2935a0a
Comment 19 Quality Engineering 2013-02-19 01:51:00 UTC
Integrated into 'main-golden', will be available in build *201302182300* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main-golden/rev/268ae2935a0a
User: Jaroslav Havlin <jhavlin@netbeans.org>
Log: #202833: Add ability to filter the listed database/schemas in the Databases node
Comment 20 matthias42 2013-02-24 10:32:57 UTC
One corner case was forgotten: In org.netbeans.modules.db.explorer.action.ToggleImportantAction#enable. The Action Name is only set in the "enabled" case. This is visible after starting the IDE and selecting the main database entry. Please apply the following - it sets the action name to "Toggle important" if it is disabled:

--- Base (BASE)
+++ Locally Modified (Based On LOCAL)
@@ -95,6 +95,10 @@
             return true;
         }
 
+        actionDisplayName = actionDisplayName = NbBundle.getMessage(
+                ToggleImportantAction.class,
+                "ToggleImportant");                                  //NOI18N
+        
         return false;
     }
Comment 21 Jaroslav Havlin 2013-02-26 14:54:13 UTC
(In reply to comment #20)
> One corner case was forgotten: [...]
Thank you, Matthias.
Fixed in http://hg.netbeans.org/core-main/rev/239f5bc6a7dd
Comment 22 athompson 2013-02-26 18:35:29 UTC
Matthias, have I mentioned recently that YOU'RE THE MAN? Outstanding!
Comment 23 Jiri Rechtacek 2013-02-26 18:40:30 UTC
(In reply to comment #22)
> Matthias, have I mentioned recently that YOU'RE THE MAN? Outstanding!

Absolutely agree, the big thank you, Matthias.
Comment 24 Quality Engineering 2013-02-27 16:12:04 UTC
Integrated into 'main-golden', will be available in build *201302270948* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main-golden/rev/239f5bc6a7dd
User: Jaroslav Havlin <jhavlin@netbeans.org>
Log: #202833: Set ToggleImportantAction name also if it is disabled
Comment 25 athompson 2013-04-12 15:28:13 UTC
yup.
Comment 26 matthias42 2013-05-13 19:04:19 UTC
*** Bug 153622 has been marked as a duplicate of this bug. ***