Export to SQL, JSON, SVG, and PNG
Click Export in the top bar (⌘E, or Ctrl+E on Windows and Linux) and pick a format. SQL gives you the table definitions for your database, JSON saves the model as a Maowl file, and SVG and PNG give you images for documents and slides.
Hidden layers
In the Export dialog, Visible layers only is on by default, so anything in a hidden layer is left out, including your notes when the Notes layer is hidden. Hiding the Columns layer affects only SVG and PNG, because SQL and JSON always include your columns. Turn the option off to export everything.
SQL
Choose your database under Database: PostgreSQL, MySQL, SQL Server, or
SQLite. You get one CREATE TABLE statement per table, ready to copy or download
as a .sql file.
- Tables and columns. Each table is named after its table name, and its columns come in the same order as on the card. A name that needs quotes in your database gets them.
-
Data types. A type written the way your database writes it, such as
VARCHAR(50)orNUMERIC(10,2), is kept as it is. A type from the dropdown is written as your database's own, so INTEGER becomesINTEGERin PostgreSQL andINTin MySQL. A column with no data type is text. -
Keys. The columns checked as Primary key become the
PRIMARY KEY, in key order. Other unique columns getUNIQUE, and required ones getNOT NULL. -
Foreign keys. Each foreign key runs from the table it starts at to the
table it points to, held in the foreign key's first column. If it has none, the export
uses a column named after the other table and its key, such as
customer_id, and adds it when the table doesn't have it yet. A table that's pointed to but has no primary key gets anidcolumn as its key. Foreign keys come after the tables asALTER TABLE … ADD CONSTRAINTstatements, or inside each table for SQLite.
Import the exported file into Maowl again, and you get the same tables back. See Import and merge.
JSON
A JSON file holds your model: tables, foreign keys, notes, layers with their visibility and locks, the model style, and the model's name. File › Save as file… always saves the whole model, and File › Open… opens the file again. You can also import a JSON file into the model you have open. The file records when the model was created and last changed, but nothing that identifies you.
SVG and PNG
Images use the same font as the canvas and include everything that's drawn, from borders and table names to columns and foreign key names, with a margin around it all. For a sharper PNG, choose a higher Resolution. Turn on Transparent background to leave out the background color. With Simple mode on, images show the same simplified view.
Preview what an image will include
To see what an image will cover, click Zoom to fit in the zoom bar or press 0.
Cypher, for teams that also use Neo4j
The Cypher tab writes your model as a Neo4j script. Choose Full script to set it up in Neo4j with sample data from your example values, or Constraints only to get just the constraint statements, which you can run again without changing anything. A Unique column becomes a uniqueness constraint and a Required column an existence constraint, which needs Neo4j Enterprise Edition or Aura. Using Neo4j Data Importer? Under JSON, choose Neo4j Data Importer to get a file you can open there.