Import and other formats
How to import a model from SQL (CREATE TABLE), DBML, Mermaid or Markdown, and how to import objects from another .erm file. Importing by connecting to a database is covered in Databases.
Import menu
| Menu › Item | What it does |
|---|---|
| File › Import › From DB… | Connects to a database and imports its structure. Databases |
| File › Import › From file… | Picks objects from another .erm file and adds them. |
| File › Import › From SQL, DBML, Mermaid or Markdown… | Builds a model from a text file or pasted text. Works without an open document. |
Dragging an .sql, .ddl, .dbml, .mmd, .mermaid or .md file onto the window, or opening one with File › Open…, also opens this import dialog (nothing is added right away).
Importing from SQL, DBML, Mermaid or Markdown
Input
| Field | Description |
|---|---|
| Input | File or Paste. Files up to 32 MB, pasted text up to 8 MB. |
| File path | .sql · .ddl · .dbml · .mmd · .mermaid · .md. Pick it with Browse…. |
| Encoding | Auto-detect (BOM, UTF-8) by default. For a file that is not UTF-8 and has no BOM, you are asked to choose the encoding (it is never guessed). |
| Format | Auto-detect · SQL · DBML · Mermaid · Markdown |
| Dialect | For SQL — Auto-detect · PostgreSQL · MySQL/MariaDB · Oracle · SQL Server · Standard SQL |
Files with CREATE TABLE statements, such as pg_dump, mysqldump, SSMS scripts or Oracle DDL, are read as they are. Statements that cannot be read are skipped with a warning.
Destination and options
- Import into — New document (a new untitled tab) or Merge into the current document. If no document is open or it is read-only, only New document is available.
- The new document uses the database the format specifies. If the format does not specify one, the database you chose is used (or, if the SQL dialect is known, that database).
- Read comments as — Where comments go: Automatic (logical name : description) · Description only · Logical name only.
- Convert unquoted names to the database's default case — When on, unquoted names are converted to upper or lower case following that database's rules.
Preview
Click Preview to see, before anything is added, how many tables, columns, relationships and indexes were found, along with warnings and info. For large files, "Reading… n s" is shown; Cancel stops without changing anything. Back returns to the input.

When names clash
When merging into the current document and objects with the same name exist, you choose how to handle them after clicking Import.
| Action | What it does |
|---|---|
| Overwrite | Replaces the contents only; position, color and categories stay as they are. |
| Skip | Does not import that object. |
| Add with a new name | Adds it under a different name. |
Decide for all at once with Apply to all remaining, or per object with "(choose one by one)". The whole merge is undone with a single undo (Ctrl+Z).
Result
After importing, the Import result (or Merge result) window shows how many objects were created (merged) and lists the warnings by Line:col · Kind · Details · Skipped text. Copy list copies them, and the same warnings are kept in the problem list.
Tip
You can import SQL made by another tool, refine it in Relio, and export it again as DBML or Mermaid. With the command-line relio import, you can create an .erm without opening the app. Command line
Importing from another .erm file
Choose File › Import › From file… and pick an .erm file to see the Objects to import (this file's DB: …) list. Tables, views, notes, column groups, sequences, triggers and tablespaces are grouped by kind, and the checked ones are added to the current document (kinds the file does not have are not shown, and images cannot be selected). Everything is checked at first; with Merge words at the bottom turned on, words with identical contents are merged into one.
- For objects with the same name, choose Overwrite · Skip · Add with a new name as above.
- A category whose name matches an existing one (ignoring leading and trailing spaces and case) is not created again; its members are just added to that category.
- The whole import is one undo step.