Data Explorer

The Data Explorer shows the rows of a table and of the tables linked to it. Click a customer, and the next table lists that customer's orders. You can also edit, add and delete rows there, without writing SQL.

The Data Explorer with customers on the left and the orders of the selected customer on the right, linked by an arrow

A foreign key is a column that points to a row in another table, such as orders.customer_id. The Data Explorer uses it to show the rows that belong together. Following foreign keys needs DbSchema Pro.

  1. Right-click a table on the diagram, such as customers, and choose Data Explorer.
  2. The explorer opens under the diagram. To give it the whole diagram area, double-click its tab.
  3. Click a row.
  4. Click the arrow button next to the table name. It lists the tables linked to this one.
  5. Choose a table, such as Cascade orders via orders_customer_id_fkey.

A second table opens, joined to the first by an arrow. When you click another customer, the orders table reloads with that customer's orders. From the orders table, you can follow the next foreign key in the same way, to order_items or payments.

If your database has no foreign keys, the explorer can follow virtual foreign keys, which exist only in the DbSchema model.

Query → Data Explorer, or Ctrl+R, opens an empty Data Explorer instead of one that starts from a table.

Filter the rows

Each table has a filter box above its rows. Type a condition in SQL, such as status = 'CANCELLED', and the table shows only the rows that match.

The orders of one customer, filtered with status = 'CANCELLED' to three rows

The filter adds to the foreign key link. Here, the orders table shows the cancelled orders of the selected customer only.

Edit, add and delete rows

Changes you make here run in the database at once.

  • Edit a value: double-click a cell, type the new value and press Enter. DbSchema asks you to confirm the update, then saves it.
  • Add a row: press + at the bottom of the table. A new row appears. Fill in the values, then press the save button next to +. In a linked table, DbSchema fills in the foreign key for you.
  • Delete a row: select it and press the trash button at the bottom of the table.
A new row in the orders table, with customer_id already set to 7 and the other columns NULL, and the save, add and cancel buttons at the bottom

In the picture, the new order gets customer_id 7, the customer selected on the left. Press the cancel button to drop a new row before it is saved.

Next steps