Using Nile's Schema Visualizer
Nile's web console includes a built-in schema visualizer that allows you to view the schema of your data in a graphical format. This visualizer is a great way to understand the structure of your data and to identify relationships between different types of data.
This guide will walk you through some of the schema visualizer's key features and how to use them. Or, you can watch a video tutorial:
Accessing the Schema Visualizer
To access the schema visualizer, log in to the Nile web console and navigate to the "Schema" tab.
Exploring the Schema
The visualizer will show the public schema by default. This schema will include the built-in tenants
table and any other tables that you have created in this schema.
You can click and drag tables to move them around, click and drag on empty space to pan around,
or hold the option
or alt
key while scrolling to zoom in and out.
Clicking on a table will also highlight this table and all the tables that it references via foreign keys. This can help you understand the relationships between different tables in your schema.
Tables that have a foreign key to a table in another schema will be shown with a dotted line connecting them to the referenced table. Referenced tables in another schema will only show the referenced column, not every column in the table, and they will have the schema name on the top of the box.
In the screenshot below, you can see that the comments
table has
a foreign key to the todos
table in the same schema, and to the tenant_users
table in the users
schema.
Switching between Schemas
As you can see in the screenshot above, tables that belong to a different schema also have a button to navigate to that schema. This is a quick way to follow references and understand the relationships between different tables in your database, even if they are in different schemas.
In addition, you can use the dropdown at the top of the visualizer to switch between different schemas in your database. The dropdown shows all the schema in your database, and you can select any of them to view their schema. Nile's built-in schemas will have a special icon next to them, but you can otherwise navigate them just like your own schema.
Modifying the Schema
Schemas are modified using normal DDL commands, such as CREATE TABLE
, ALTER TABLE
, and DROP TABLE
.
The visualizer will automatically update to reflect these changes, so you can use it to see the impact of your changes in real time.
Note that the visualizer caches the schema for a short period of time, so it may take a few seconds for changes to appear. You will see a message at the top of the visualizer when the schema is being refreshed from the database.
Enjoy iterating on your schema with the visualizer!