Database schema reference

The DB Sync database schema defines the structure of your database, used by the DB Sync framework to implement the synchronization process.

Purpose of the database schema

The DB Sync database schema is a JSON file specific to a given application database, that contains the definition of the SQL tables used in the synchronization process.

The schema is used by the DB Sync framework modules, and needs to be shared by the server applications and by the DB Sync client apps.

The database schema definition used by the DB Sync client app must match the schema used by the central DB Sync service in both name and version.

Database schema content

The schema contains following information:
  • name: The name of the database
  • version: The version of the database schema
  • serial_emulation: The serial emulation (if needed)
  • tabs: The list of SQL tables, with information described in SQL table definition.

Generating the database schema

The DB Sync database schema file is a JSON file that can be generated from an existing SQL database.

The dbsync_schema extract command is used to extract schemas from an existing database:

dbsync_schema extract extract-options

This command will produce a JSON file from the SQL system tables, fetching all SQL table / columns definitions with column types, primary keys, foreign keys and auto-incremented column information.

Once generated, you must complete the DB Sync database schema before is can be used by the DB Sync framework.

For more details, see dbsync_schema.

Editing the database schema

The DB Sync database schema can be modified with a graphical tool.

To edit the DB Sync database schema, use the schema editor. The schema editor is started with the following command:

dbsync_schema edit -c dbsync_config.json

For more details, see Database schema editor.