Skip to article
Documentation

Import, export, and synchronize

Bring in existing schemas and share diagrams and documentation.

On this page

Import an existing schema#

Open the DBML editor context menu and choose DBML Import. Select SQL, Prisma, or CSV as appropriate. For SQL, select the dialect, including Oracle when needed, and review the report of skipped statements. Inspect indexes, composite keys, defaults, checks, and referential actions after conversion.

CSV import detects delimiters and quoted or multiline values. Review inferred column types and nullability before accepting, and override types that should not be inferred from the sample. Include sample records only when they are appropriate to retain in the schema.

Export code and documentation#

Use DBML Export to create SQL DDL, Prisma, TypeScript interfaces, or documentation. Review generated output before incorporating it into an application or database migration. Exporting SQL is distinct from executing it against a live database.

For a diagram image, export the displayed view as SVG, PNG, or PDF. The current DiagramView and layout determine the result. Markdown and HTML documentation retain rich notes; custom properties can be displayed or filtered for the intended audience.

Synchronize with dbdiagram#

  1. Install and authenticate the official CLI as described in Configuration.
  2. Use dbdiagram → Initialize dbdiagram Project… to link the local project.
  3. Review the target before pushing. A push updates the remote diagram.
  4. For a pull, review the presented diff and choose Apply pull only when you want the remote changes written locally.
  5. Use Publish to dbdocs… when you intend to publish documentation.

Commit the schema, shared layout, and non-secret CLI settings together. A pull does not silently replace the source before you apply it.

Manual for version 2026.2.4 · Reviewed