This tutorial covers the main DbSchema features:
Feature | Description | |
---|---|---|
Connect to the Database | DbSchema can connect to any SQL and many No-SQL databases | |
Reverse Engineer the Schema | Will load the schema structure from the database. | |
Create Layouts | The layouts are diagrams with tools. You can create multiple layouts with the same or different tables. | |
Create or Edit Tables | Create and edit tables directly in the diagram. | |
Document the Schema | Add comments to tables and columns. | |
Generate HTML5 Documentation | Interactive HTML5 diagram with the vector image of the diagram. | |
Design Schema in Offline Mode | Design the schema without connectivity to the database. | |
Compare and Synchronize the Design Model with the Database | The design model stores its own image of the schema structure. This can be compared or deployed on any database. | |
Design the Schema in a Team | The model file can be shared in a team using GIT, and can be later deployed on any database. | |
The Relational Data Editor | Visual explore data from multiple tables simultaneously, bind by foreign keys or virtual foreign keys. | |
Virtual Foreign Keys | The virtual foreign keys won't be implemented in the database. | |
The Query Builder | Visually build SQL queries. | |
The SQL Editor | Edit and execute SQL queries. | |
The Random Data Generator | Fill tables with random generated data. | |
The Data Importer | Import data from CSV, Excel or XML files into the database. | |
Automation Scripts | Automate different tasks using Java Groovy scripts. | |
MongoDB Features | View the MongoDb structure as diagrams and implement validation rules. | |
Logical Design | Design a database-independent model which can be deployed for any database. |
Choose the location of your database server ( localhost - on your computer or remote - on a different machine ) and the authentication.
In the JDBC URL, you can choose Edit Manually to enter the JDBC URL directly. Use this with cloud databases, as usually you can find the JDBC URL in the cloud console.
After connecting to the database, DbSchema will reverse engineer the schema and show the tables in layouts.
On the left side you can see:
A layout is a diagram with tools. The layouts are part of a tab pane. Get a better understanding of the schema by creating multiple layouts, with the same or different tables.
Add tables to the layout by clicking the foreign key icon.
Create foreign keys by dragging one column over the referred column.
Edit existing tables by double-clicking the table header.
Right-click the layout and choose to create a table.
Use the table dialog to create or edit columns, indexes, constraints, and foreign keys.
Some databases are using by default upper cases. DbSchema tries to use the same cases as the database, in order to avoid using quotes. This is configurable from 'Schema / Use DBMS Preferred Letter Cases'.
DbSchema can generate HTML5, PDF, or Markdown documentation. The option is available in the Layout menu.
The HTML5 documentation can be opened using any Web browser. Read the table, column, and foreign key comments by hovering them with the mouse.
DbSchema can work connected to the database or offline (without database connectivity). You can continue to add new tables and columns. They will be saved to the design model file.
Later, you can connect back to the database and deploy the changes into the database.
DbSchema is showing the schema structure from the design model. The design model can be saved to file. At startup, DbSchema is opening the latest saved design model file.
To ensure the design model is the same as in the database, press 'Refresh Schema from Database'.
The Schema Synchronization dialog will allow to:
You can set a filter to automatically reject differences.
The same dialog will show if you choose to upload the schema into the database.
You can also compare the design model with another model from the file.
The design model file is using the XML format. The file can be saved in a GIT repository and shared with a team.
From the model menu, you can open the GIT dialog to view the different revisions of the design model file, and:
Click table headers to open any of the main editors: Relational Data Editor, SQL Editor, Query Builder.
The Relational Data Editor can view data from multiple tables simultaneously. The tables should have foreign keys or virtual foreign keys. There is no limit for the number of open tables.
Clicking a record in one table will refresh the children tables and show the matching records, based on the foreign key column match.
Double-click cells to edit, set filters and switch from table to tree view.
The editor will be saved into the design model file and can be reopen next time you start DbSchema.
Virtual Foreign Keys are defined only in DbSchema, and won't be created in the database. They will be saved to the model file. Foreign keys can be created by drag of one column over the referred column, then tick the 'virtual' checkbox in the Foreign Key dialog.
Virtual Foreign Keys can be used in Relational Data Editor and Query Builder, and they help to understand the schema structure.
Use the Query Builder to create SQL queries using the mouse. Click the foreign key icon near columns to join further tables.
Tick the columns to select. Right-click columns to add filters or aggregate columns, which will turn the query into a GROUP BY.
Using the SQL Editor you can edit and execute queries.
The editor features text-autocompletion and explain-plan.
The Data Generator can fill tables with random-generated data. The generator uses configurable patterns to generate numbers, text using reverse regular expressions, lists, values from foreign key tables, etc.
Import data from CSV, XLSX, XLS or XML into the database.
Tasks like generating the HTML5 documentation can be automated using Java Groovy scripts. Java Groovy is 100% Java. The Tools / Automation Scripts Dialog is showing different use cases.
Copy the script into the SQL Editor and switch from SQL to Java Groovy.
MongoDB databases do not have a schema. DbSchema can show the validation rules ( if present ) or 'introspect' the schema and show the collection structure as diagrams.
DbSchema is featuring Query Builder and Query Editor for MongoDb.
The logical design is database-independent design and uses entities, attributes, and relations. The relations can be Identifying or Non-Identifying, Many-to-Many, Mandatory, and can have a Cardinality.