Understanding complex relational architectures with hundreds of interconnected tables is virtually impossible by reading SQL CREATE TABLE definitions alone. DBeaver includes a built-in Entity-Relationship Diagram (ERD) engine that automatically reverse-engineers physical database schemas into clean, interactive conceptual models.

1. Reverse Engineering Any Schema in Seconds

DBeaver can generate ER diagrams at three distinct structural granularities:

  • Database or Schema Level: Double-click any Schema in the Database Navigator and click the ER Diagram tab. DBeaver reads all physical Foreign Key constraints and constructs a complete topological map of the schema.
  • Table Level: Double-click an individual table and open its ER Diagram tab to see an isolated view of that table and its immediate parent and child dependencies.
  • Custom Project Diagram: Create an independent .erd file in the Projects View, allowing you to drag-and-drop arbitrary tables from different schemas or even different database connections!
💡 Performance Notice for Enterprise Schemas

When reverse-engineering schemas with more than 300 tables, DBeaver will prompt you before rendering to prevent memory exhaustion. You can filter out audit log or partition tables in Preferences → Database → Editors → ERD → Entity Filter.

2. Cardinality Notations: Crow's Foot vs. IDEF1X

DBeaver supports standard industry modeling notations. You can switch between them in the ERD canvas toolbar or preferences:

Notation Style Visual Representation Best Used For
Crow's Foot / Bachman Three-pronged fork branch indicating "Many", single perpendicular bar for "One", and circle for "Zero / Optional". Modern software engineering, Agile development, and team architectural documentation. Highly intuitive for developers.
IDEF1X Solid filled dot at the child end for "Many", dash/diamond representing optional or mandatory relationship blocks. Government, aerospace, defense, and strict federal data modeling standards requiring formal identification of dependent entities.

3. Virtual Foreign Keys: Modeling Without Schema Locks

In modern cloud-native architectures, sharded databases, or high-throughput microservices, physical foreign key constraints are frequently omitted from the database catalog to minimize write locking overhead. As a result, standard ER diagram tools display hundreds of disconnected floating boxes.

DBeaver solves this problem with Virtual Foreign Keys:

  1. Open the ERD canvas.
  2. Right-click on the child entity table and select Create → Virtual Foreign Key.
  3. Select the parent table and map the source column (e.g. orders.customer_id) to the target reference column (e.g. customers.id).
  4. Click OK.

The virtual relationship appears immediately on your diagram. It is persisted inside your local DBeaver project metadata without executing any DDL or modifying the production database schema. Furthermore, once defined, DBeaver's data editor enables one-click foreign-key hyperlinking between tables in the data grid!

4. Layout Algorithms & Visual Styling

A diagram with overlapping connection lines is counterproductive. DBeaver offers automated layout engines and custom visual controls:

  • Auto-Layout (Ctrl + Shift + L): Automatically computes optimal node coordinates using force-directed or hierarchical graph algorithms to minimize link crossings.
  • Routing Style: Choose between Orthogonal (clean 90-degree right angles, best for architectural reviews) or Direct (straight lines, best for quick inspections).
  • Domain Color Coding: Right-click tables to assign distinct header background colors (e.g., green for billing_*, blue for auth_*, orange for inventory_*).
  • Attribute Visibility: Toggle between showing all columns, primary keys only, or foreign keys only.

5. Exporting Models to SVG, PNG & GraphML

To include your database architecture in engineering wikis (Notion, Confluence, GitHub README):

  1. Right-click anywhere on the ERD canvas and choose Export Diagram.
  2. Select your format:
    • SVG (Scalable Vector Graphics): Vector-based, infinitely zoomable, pristine typography. The recommended format for web documentation.
    • PNG / BMP: Raster images with configurable resolution scale (1x, 2x, 4x retina).
    • GraphML: Export raw graph nodes and edges for advanced graph analysis in tools like Gephi or yEd.
  3. Save the output file to your repository.

6. Generating Production DDL Migration Scripts

DBeaver is not merely a read-only viewer; it is an authoring workbench. You can extract complete Data Definition Language (DDL) scripts from any entity:

Generated DDL Sample
-- DDL Generated by DBeaver Schema Introspector
CREATE TABLE public.order_items (
    item_id BIGSERIAL NOT NULL,
    order_id BIGINT NOT NULL,
    product_sku VARCHAR(64) NOT NULL,
    quantity INT NOT NULL DEFAULT 1,
    unit_price NUMERIC(10,2) NOT NULL,
    CONSTRAINT pk_order_items PRIMARY KEY (item_id),
    CONSTRAINT fk_order_items_order FOREIGN KEY (order_id) 
        REFERENCES public.orders(order_id) ON DELETE CASCADE
);

CREATE INDEX idx_order_items_order_id ON public.order_items (order_id);

7. Version-Controlling Diagrams with Git

Store all your .erd diagram files inside a DBeaver Project linked to your team's Git repository. Whenever schema alterations occur, commit the updated diagram file alongside your migration scripts so documentation never falls out of sync with production code.

Next: Diagnose & Speed Up Slow Queries

Learn how to use DBeaver's Visual Explain Plan to identify costly sequential scans and optimize database performance.