Versions Compared


  • This line was added.
  • This line was removed.
  • Formatting was changed.



Visualize the structure of a database.

Available since

This macro was added in version 5.4 of the PlantUML Plugin.


Parameter datasource is required, all others are optional.


Name of datasources to visualize

(warning) Datasources must be configured by a Confluence administrator before they can be used.
A short guide can be found here.

schemaNameName of schema to visualize.
The table name is prefixed with the schema name if none is selected.

Comma separated list of types to show in graphics. The available types depend on the database. They can be determined with the database-info macro. Common ones are:

  • TABLE (default)
  • VIEW

The type will be shown as stereotype above the table name if more than one is selected.


Show only tables with these names in generated graphic.

Wildcards _ and % can be used as in a SQL SELECT. An additional filtering is possible with tableNameRegEx.


  • This selection is done inside the database. It will be faster than tableNameRegEx in most cases.
  • It depends on the database whether this is case sensitive or case insensitive

Show only columns with these names in generated graphic.

It works like tableNameFilter.


Show only tables with these names in generated graphic.

Table names are defined as regular expression, e.g. show all tables whose names start with A,B,C or D or end with NEW:

Code Block


  • tableNameFilter is executed before tableNameRegEx
  • Regular expressions are case sensitive but you can place (?i) in front to make them insensitive
  • | does not work in Confluence 3 as this character separates paramters. It requires Confluence 4.

Show only columns with these names in generated graphic.

It works like tableNameRegEx.

showColumnsIf true column names and their data types are shown.

If true and column comments comment exists they it will be shown after --.

Note: Comments are an elegant way to document a database schema but they are not part of the SQL standard. Some databases support them (e.g. PostgreSQL, Oracle), others do not (MySQL).

(available since 5.4.1)


If true and a default values exist they it will be shown after =.

(available since 5.4.1)


If true the indexes of each table are shown below the column names.

Indexes can also be shown as separate boxes by adding INDEX to the list of tableTypes but this will need more space on the graphic.


If true foreign keys will be used to determine relations between tables. They are drawn as lines.

(available since 5.4.1)


Relations between tables can also be drawn without foreign key constraints. This requires a consistent naming schema and a regular expression to describe how tables are related.

The regular expression is checked against: <tablename1>.<columname1> <tablename2>.<columname2>

A relation between table <tablename1> and <tablename2> is drawn when the regular expression matches.

The primary key of an table is named id.
A column which refers to this is named <tablename>_id.
A relation between tables person and team has to be drawn if there is for example: and team.person_id.
The regular expression hast to match:

Code Block team.person_id match.team_id

The following regular expression would do this:

Code Block
^(.*)\.id .*\.\1_id$

 Note: Only tables and columns which are shown in the output will be used the determine relations!

(available since 5.4.1)

nodeFontsizeFont size. Default is 9.

The appearance of the graphics can be changed by adding some DOT commands here. This will overwrite the default set by the macro.

Example: set minimal width of all table boxes to 3.5 inches, change background, font colour and font:

Code Block
node [ width="3.5", fontcolor="#FFFFFF", fillcolor="#222222", fontname="Serif"]; 

For more details see


PNG (default)

SVG (beta)

exportNameThe graph will be stored as attachment if exportName is given.

true = Enable debugging.




Sample Images