5.1. Diagram Export
- SVG Export
- Required parameter
- Layout selection
- Rendering options
- Interactivity options
- Output
- Examples
SVG Export
Command
ormfactory export-svg
Exports one or more database layouts as SVG diagrams.
The generated files can be published to internal documentation systems, attached to CI/CD artifacts, or stored in source control together with the database model.
Required parameter
--project=<path>
Path to the.ormfactoryproject file.
Layout selection
--layout=<name>
Layout name to export. Can be specified multiple times.--layout-exclude=<name>
Excludes specific layouts. Can be specified multiple times.--all-layouts
Exports all layouts in the project.
Selection priority:
--layout--all-layouts- First available layout (if no layouts specified)
Rendering options
--draw-grid=false
Disables grid rendering.
Default:true--fk-style=<solid|dash|dot>
Foreign key line style.
Default:solid--vfk-style=<solid|dash|dot>
Virtual foreign key line style.
Default:solid--convert-names-to-target
Converts names to target representation.--show-types-column
Shows column types.--show-unreachable-arrows=false
Hides unreachable relationships.
Default:true
Interactivity options
--enable-empty-hover
Enables interactive background highlighting for tables, fields, and relationships on mouse hover, even if no hyperlinks are defined.
--link-table-template=<template>
Hyperlink template for table headers.
Supported placeholders:
{schema}→ table schema name{table}→ table name
--link-field-template=<template>
Hyperlink template for individual table rows (columns).
Supported placeholders:
{schema}→ table schema name{table}→ table name{column}→ column name
--link-fk-template=<template>
Hyperlink template for foreign key relationship lines.
Supported placeholders:
{schema}→ source table schema name{table}→ source table name{column}→ source column name{target_schema}→ target table schema name{target_table}→ target table name{target_column}→ target column name{foreign_key}→ foreign key constraint name
Output
--output=<path>
Output file or template.
Default:diagram.svg
Supported placeholders:
{layout}→ layout name{project}→ project file name without extension
When exporting multiple layouts (--all-layouts or multiple --layout values), one SVG file is generated per layout and --output is treated as a template.
Examples
Export all layouts during CI build:
ormfactory export-svg \
--project=model.ormfactory \
--all-layouts \
--output=artifacts/{layout}.svg
The generated SVG files can be published as build artifacts
or automatically deployed to an internal documentation portal.
Export a single layout:
ormfactory export-svg \
--project=model.ormfactory \
--layout=Main \
--output=docs/main.svg
Export all layouts:
ormfactory export-svg \
--project=model.ormfactory \
--all-layouts \
--output=docs/{layout}.svg
Export with custom rendering:
ormfactory export-svg \
--project=model.ormfactory \
--layout=Main \
--fk-style=dash \
--vfk-style=dot \
--draw-grid=false
Export selected layouts:
ormfactory export-svg \
--project=model.ormfactory \
--layout=Main \
--layout=Billing \
--layout-exclude=Legacy \
--output=docs/{layout}.svg
Export an interactive diagram for Confluence/Wiki (with hovers and links):
ormfactory export-svg \
--project=model.ormfactory \
--all-layouts \
--enable-empty-hover \
--link-table-template="https://wiki.company.local/display/DB/{schema}.{table}" \
--link-field-template="https://wiki.company.local/display/DB/{schema}.{table}#{column}" \
--output=wiki-media/{layout}.svg
Note: All examples use Bash line continuation (
\). On Windows Command Prompt, replace it with^. In PowerShell, use the backtick (`) character.