Guide
Generating and Exporting ER Diagrams in DBeaver for Database Documentation
Learn how to generate ER diagrams in DBeaver, tune their layout, export to SVG/PDF/GraphML, and save the diagram file for version‑controlled database documentation.
Published by Tasadduq Burney
24 Sept 2025, 10:36 UTC
3 min105.3K views0

Desired outcome
Create a clear entity‑relationship diagram of a database schema, adjust its layout for readability, export it in a vector format suitable for documentation, and save the diagram file so the layout can be version‑controlled alongside schema changes.
Prerequisites
- DBeaver 23.x or newer installed.
- A working JDBC connection to the target database (e.g., PostgreSQL, MySQL, SQL Server).
- Sufficient privileges to read the schema’s tables and foreign‑key metadata.
Procedure
- Open the diagram view
- In the Database Navigator, expand the connection, right‑click the schema you want to document, and choose
View Diagram(shortcut Ctrl+Shift+D). - DBeaver reverse‑engineers all declared foreign keys and draws a graphical model.
- In the Database Navigator, expand the connection, right‑click the schema you want to document, and choose
- Focus on relevant tables (optional)
- Use the
Filter by namefield above the diagram to show only tables matching a pattern (e.g.,order*). - Alternatively, hold Shift and click tables to select a subset, then right‑choose
Show only selected tables.
- Use the
- Adjust layout
- Toolbar →
Auto Layout→ chooseHorizontal,Vertical, orRadialbased on the shape you prefer. - For fine‑tuning, drag tables to reposition them; relationship lines will follow.
- To increase canvas size before export, open
File → Page Setup → Custom sizeand set width/height that accommodates long names.
- Toolbar →
- Export the diagram
- Toolbar →
Export→ select format: PNGfor quick raster previews.SVGorPDFfor scalable, high‑quality documentation.GraphMLif you intend to import the diagram into yEd, Gephi, or similar tools.- In the export dialog, ensure
Export backgroundis unchecked if you need a transparent background (SVG/PDF).
- Toolbar →
- Save the diagram file for version control
- Toolbar →
Save Diagram→ choose a location inside your DBeaver project folder. - The file receives the extension
.dbeaver-diagramand stores the absolute coordinates of each table and line. - Commit this file to Git; treat it as binary (or use a diagram‑review workflow) to avoid merge conflicts.
- Toolbar →
Expected checks
- After step 1, verify that all tables with foreign‑key relationships appear as boxes connected by lines.
- After applying an auto‑layout (step 3), confirm that no tables overlap and that the direction of arrows matches the expected parent‑child direction.
- After exporting SVG (step 4), open the file in a web browser; zoom in to ensure text remains crisp and no names are truncated.
- After saving and reopening the
.dbeaver-diagramfile (step 5), the layout should match exactly what you saved.
Recovery options
- If the auto‑layout produces an unsatisfactory arrangement, use
Edit → Undo(or Ctrl+Z) to revert to the previous layout. - To return to the original reverse‑engineered view, close the diagram tab and re‑open it via
View Diagramagain. - If the exported file is missing content, re‑open the diagram, increase the canvas size via Page Setup, and repeat the export.
0 replies
A thoughtful contribution can make all the difference. Be the first to share one.