Skip to content
The latest version of DbVisualizer was released 2024-11-27DOWNLOAD HERE ->

Filtering Database Objects

Only in DbVisualizer Pro

This feature is only available in the DbVisualizer Pro edition.

Managing what database objects are listed in the Databases tab is done at two levels:

  1. Objects Filtering Defines what individual object nodes are listed for a specific object type. This allows filtering on for example Table objects so that only tables matching a condition are listed.
  2. Object Type Visibility Defines what object types such as views, tables, indexes, procedures, etc. are listed. Every database in DbVisualizer supports all sorts of database objects. Having the ability to hide some object types makes it easier to locate the database objects that are of primary interest.

The Filter Editor is used to manage object type visibility, object filters, and labels. The Filter Editor is opened from one of:

  • Database main menu and the Database Objects Filters->Open Filter Editor
  • Right-click somewhere in the Databases tab and choose Database Objects Filters->Open Filter Editor
  • Click the drop-down button on the funnel icon in the Databases tab toolbar and choose Open Filter Editor.

Managing filters and opening the filter editor requires that a node is selected in the Databases tab tree and that the related database connection is connected.

Object types list in DbVisualizer

The upper list shows all available object types for the actual database connection. The leading check mark controls whether the object type should be visible in the Databases tab. Read more in the Object Type Visibility section. The Filter(s) column shows any filters defined for each object type. A green check mark symbol indicate that at least one filter is active while a yellow cone symbol indicate that all filters for the object type are deactivated.

Selecting an object type enables the objects filtering area in the lower part of the window. Here individual filters are defined for an object type.

Object Filtering

Object filtering can be made on any database object (Table, Function, Procedure, User) except for grouping objects such as Tables, Functions, Procedures, Users. Grouping objects in DbVisualizer are often labeled with the related object type name in plural.

Object Filters for Database and Schema objects also apply to the corresponding drop-down lists in SQL Commander tabs, but only after a reconnect.

To setup a filter, select the object type in the objects list and in the filter area, click the button with a plus sign to insert a new row.

Setting up a filter in DbVisualizer

A filter entry consists of a field (e.g Label), a condition and a value to match against. Click the condition field to select the condition to use. In the Value field, enter the value that should be matched. For multi value conditions, such as is in and isn't in, the list of values are separated with a semicolon or edited in separate window that is opened by pressing the right-most icon in the input field.

Each individual filter can be deactivated using the check mark. Uncheck it and the corresponding filter will not be used unless reactivated. The currently defined filters are listed in the upper object type list for each object type. The leading symbol shows either a green check mark which indicates that some of its filters are active or a yellow cone symbol that shows that no filter is active.

You can define more than one filter. Just click the green plus or yellow star (to duplicate an existing row) buttons. If you have more than one active filter, you must also select if the filter should match Any or All filter entries.

Filter entries (rows) can be moved up/down to arrange the filters, just select one ore more rows and use the popup menu Move Up/Move Down. You can also use Drag&Drop to move the rows.

Inline Objects Filtering

The filter area can also be displayed just below the objects tree in the Databases tab. This is convenient as you can then quickly manage and verify the effect of certain filters. To toggle the display of the filtering area, either click the left part of the funnel icon in the Databases tab toolbar or click the right menu arrow and select Database Objects Filter->Show/Hide Filter Area.

Managing filters and opening the filter editor requires that a node is selected in the Databases tab tree and that the related database connection is connected.

Inline objects filtering in the Databases tab

In this example, the filter area is displayed with the filters for the Tables object type listed. When filters have been modified, you need to manually apply the filters using one of the reloadbuttons in the filter area toolbar or in the Databases tab toolbar. If a filter results in all object nodes being filtered, "(all filtered)" is displayed next to the parent object node in the tree. Since the filtered object type is now invisible as a result of the current filter, you need to disable the filter to refine it. Do this by selecting the parent node with the "(all filtered)" label and then click the "Disable Filters" link just below the objects tree:

Disabling filters in DbVisualizer

Clicking "Disable Filters" deactivates all filters for the object type and you are now able to modify the filter to get the matches you want.

Object Type Visibility

Object type visibility is the functionality used to define what object types should be visible in the Databases tab. For some databases, the tree of object types can be really long and many objects are rarely used or of minor interest. By hiding object types, the tree is compressed to only show what you are really interested in. To control the visibility of object types, open the Filter Editor.

Database tree before and after setting visibility

The previous image shows the object types available under a Schema in H2. As you can see, there are plenty of them (sub object types are collapsed in the example for better illustration). The following example shows the database tree in the Databases tab before and after the visibility has been set based on the previous screenshot.

All Schema objects displayedWith hidden Schema objects

Temporarily Disable Filtering

While browsing the objects in the Databases tab, it may be convenient to quickly toggle between the standard non filtered view and the filtered view of objects and types. This is easily accomplished with the Disable Filtering action in the funnel drop-down menu. While filtering is disabled, the funnel symbol in the toolbar shows a red indicator and text in the inline filtering area shows the current status.

Filtering status in the toolbar

While filtering is disabled it is not possible to manage filters at all and the related actions are disabled.

Disabling filters is applied per database connection. This means that if you disable the current filter set on a MySQL connection it wont affect any filters defined for other database connections.

Filter Sets

When you apply an object filter or hide an object type, that configuration is saved in a Filter Set that is saved between sessions. For every database connection, there is always a defaultfilter set. If you are happy with the basic filtering capability you can stop reading here. If you however are interested in having multiple filter sets that can optionally be shared between multiple database connections and easily be switched between, keep on reading.

Filter sets are managed in the filter editor. Here you can create and delete filter sets and merge from another. Filter sets are either associated with a specific database connection, its name is then default for <database connection name> or a custom filter set that can be enabled for many connections, named as you like. A custom filter set is always associated with the database type currently being used for your database connection. The latter means that you are able to share filters sets that are all associated with the same database type. If you create a filter set for MySQL then this will never show up if you are working with an Oracle database.

The Filter Set drop-down in the filter editor shows the currently used filter set, and when clicked, the available filter sets that you may switch to.

The merge functionality (the blue merge arrow button) can merge not only from custom filter sets but also from the default filter sets associated with other database connections with the same database type.

Switching Filter Set

In the filter editor, you switch filter set by selecting one from the Filter Set drop-down. In the Databases tab, there is the funnel symbol which when clicked is used to toggle the display of the inline filter area. Clicking on the funnel drop-down symbol opens a menu:

Switching between filter sets in DbVisualizer

At the top of the menu, the default filter set for the database connection is displayed first with any custom filter sets below it. An entry that is check marked indicates that it is active.

Show Only Default Database/Schema filter

There is a special filter used to filter any database and schema objects to show only the default for the session. It is listed as Show Only Default Database/Schema in the filter menu. When selected, a special filter is applied on the corresponding Database and/or Schema object type and the effect is what its name implies.

Labels

The label displayed for an object in the Databases tab is composed from variables associated with the database object. These labels can be modified in the Filter Editor (Database Objects Filters->Open Filter Editor in the Database main menu). Here is an example how the object label look for a column object type in the Databases tab:

Example of object label for a column object type

In the Filter Editor click the Labels button in the top right corner of the window. Two columns, label and label1 now shows how each object type should be labelled. The selected row for the Column object type shows that the first label should be rendered with the value from ${getColumnDefinitions.COLUMN_NAME} and the label1 is ${getColumnDefinitions.TYPE_NAME}.

Modifying labels in the Filter Editor

The variables used in the Label column should rarely be altered. Label1 on the other hand can be modified to show for example the column comment (if any), i.e. ${getColumnDefinitions.COMMENT}. For the Column object type and its getColumnDefinition variable scope these are available:

  • COLUMN_NAME
  • SIZE
  • SCALE
  • TYPE_NAME
  • NULLS
  • AUTO_INCREMENT
  • ENCODING
  • COMMENT
  • IS_INVISIBLE
  • COLUMN_DEFAULT
  • IS_PRIMARY_KEY

Note that the variables are not documented as these are all database specific and obtained dynamically in the database profile for each database.