DB Explorer

The DB Explorer plug-in is a tool that allows you to view, create and modify data stored in a relational database.

To design a good report, it is important to know your data. DB Explorer provides the concept of "show data", where you can see the data stored in the rows of a database table. You can view this data from the table perspective, or from the business record perspective. By knowing your data, you are better equipped to write valid expressions and reports that your readers will understand.

When testing your report design, you may need to see how the report handles specific data values. For example, you may have a sales report where you want to highlight all sales that are above (or below) a certain value. You may need to modify your table data in order to have a row that meets the criterion. In a more extreme example, you may simply have the table schema without any data records. You may need to provide the sample data yourself.

The DB Explorer plug-in exists for these reasons, and more.

Layout of the view

Figure: Table data in DB Explorer


DB Explorer showing the contents of the country table.
At the top of the view, an editable combobox allows you to select a previously written SQL query, edit the current SQL query, or enter in your own SQL query. Next to this field are three icons:
  • The Edit SQL query icon opens the Query Editor.
  • The Execute query icon executes the displayed query.
  • The Choose connection information icon allows you to change your database connection.
Under the combobox, there are four icons for data modification.
  • Save icon - Saves changes to the current row.
  • Insert icon - Creates a new, blank row.
  • Copy icon - Create a copy of the selected row.
  • Delete icon - Delete the selected row.

The data itself displays in the scrollable table container at the bottom of the view.

When to use

Use DB Explorer to quickly view or make changes to your data. It is important to understand that, by using DB Explorer, you are making actual changes to the data in the tables; these changes are permanent. As such, DB Explorer is intended as a developer tool, not as a production tool.

Limitations

The following SQL commands are not supported:
  • SQL commands that output information as text (for example, a command that shows a list of tables) will execute, however the text will not display.
  • SQLite-specific commands (known as dot commands, such as .show) are not supported.

When you change or modify data using this tool, the changes are done under-the-covers by SQL statements. These SQL statements are governed by the rules of the database itself. The change needs to be valid by the rules of the database, in order for the query to run successfully.

You cannot use DB Explorer to view or edit binary data (BLOB data type). In addition, for some databases you cannot use DB Explorer to view or edit text-based large objects, such as the CLOB data type in IBM-Informix database servers.

DB Explorer will always work with the actual database structure. You may have made changes to the tables and column definitions in the database meta-schema file (.4db), but if those changes are not made to the actual database, they are ignored by DB Explorer. Conversely, if changes are made to the underlying database structure (through the use of DDL or another database tool), the meta-schema file (.4db) must be manually updated using the Database > Update Schema menu option.