No documentation was found matching the provided version! Browsing the latest one.

8.2.2. Split database model format

This plug-in introduces a new file format to store database models called the split database model (.sdbm). It was designed to improve the version control of model files by saving the XML code of the objects in individual files. This way, it is easier to track the changes made in each database object when the model is handled by several people in a team. Below is an example of how the split database model is arranged:

The .sdbm is a variant of the classic .dbm file where some metadata of the database model are stored but with the difference that in this file instead of having all objects' XML code attached there are references to database object files .dbo which in turn store the XML code that defines each object. Each .dbo file is categorized and saved in the folder related to the database object type. For example, the database definition is stored in the file 01_demodb.dbo in the subfolder database. The table schema_a.table_d is saved in 11_schema_a_table_e.dbo in the folder table, and so on. The following image shows an example of the demodb sample model saved in split mode.

pgModeler still relies on the classic .dbm files when loading the split database model. In resume, when opening a .sdbm, pgModeler reconstructs the entire database model by parsing the .sdbm and .dbo files, creating a temporary .dbm file where all the modifications will be applied during design time. Every time the user saves the model, pgModeler automatically updates the split database model definition so it can stay synchronized with the temporary one.

To help the user identify the database model file types that are being handled, pgModeler shows, at the base of the design area (see the image), the badges .sdbm for models loaded from .sdbm and .dbm for models loaded from .dbm files. When working with split models, both badges are displayed to indicate that pgModeler is taking care of the original .sdbm and the temporary .dbm file created from the loading process of the split model. Finally, if you are working with a classical .dbm file and want to save it in the split format, just click the action to create a split version of the model.

8.2.2.1. Handling split database models in CLI

The pgModeler command-line tool also provides some operations that can be performed over split database models. The first one, --export-sdbm, allows the user to export a split database model (.sdbm) like it was a common (single) database model file (.dbm). The other option, --fix-sdbm, is used when you have a broken split database model file and need to fix it so it can be loaded again in pgModeler's graphical user interface. Lastly, the option --rebuild-index is used to reconstruct the main .sdbm file from an input directory that is known to store a split database model.

pgModeler Plus command line interface.
Version 1.2.0 - 20250505.f521fbfa8 Qt 6.8.3
PostgreSQL Database Modeler Project - pgmodeler.io
Copyright 2006-2025 Raphael Araújo e Silva 

...

Plugins options: 
 -lp, --list-plugins              Lists available plugins.
 -ip, --ignore-faulty             Ignores errors from plugins that failed to load.

SDBM export plug-in options: 
  -xs, --export-sdbm              Runs the export operation over a split database model (.sdbm)

SDBM fix plug-in options: 
  -fs, --fix-sdbm                 Runs the database model fix operation over a split model file (.sdbm)
  -ri, --rebuild-index            Rebuilds the index file by scanning subfolders on the input file path.

...


Note that some of those options need to be used together with one of the export options or with the model fix operation switch, see the following examples:

  • Exporting a split database model to PNG image:
    ./pgmodeler-cli --export-sdbm -ep -if ~/demo_split/dbmodel.sdbm -of ~/demo_split/dbmodel.png

  • Fix a split model's structure:
    ./pgmodeler-cli --fix-sdbm -fm -if ~/demo_split/dbmodel.sdbm -of ~/demo_split/dbmodel_fixed.sdbm

  • Reconstruct a split model's index:
    ./pgmodeler-cli --rebuild-index -if ~/demo_split/demo.sdbm


May 5, 2025 at 11:24