/qgis-lizsync-plugin

Primary LanguagePythonGNU General Public License v2.0GPL-2.0

Lizsync

Introduction

LizSync is a set of tools allowing to perform PostgreSQL database synchronization between a central database and one or many clone databases.

  • The central database is the full PostgreSQL database, containing stable data. It is the source of trust.
  • The clone database is a PostgreSQL database installed on a computer, other server, tablet. It contains a subset of schemas and tables from the central database. It may be droped or recreated. It has been created by deploying an archive created with the QGIS plugin.

Synchronization is done for data of tables in chosen schemas, between tables having the same structure. No synchronisation is made on structure changes (adding a column, creating or droping tables, etc.).

It is based on PostgreSQL and QGIS:

  • PostgreSQL:
    • a schema audit contains tables, functions and triggers in charge of recording every actions made on tables: inserts, updates and deletes. It is a (small) adaptation of the audit trigger tool
    • a schema lizsync contains tables and functions helping to manage the sync actions, stores history and information on central and clones databases.
  • QGIS with a set of processing algorithms to help the user to:
    • prepare a database for synchronization,
    • create an archive from database and deploy it on clones,
    • and perform the synchronization.

Documentation

You can learn about LizSync concepts and use cases by ready the full documentation

Demo !

Videos on youtube:

Scripts

We provide a Makefile which helps the developpers to:

  • run tests,
  • build the documentation (Database structure and Processing algorithms)
  • and generate the SQL files used for installing the structure in a PostgreSQL database.

Tests

  • Unit tests can be run with:
make tests
  • Database test migration can be run with:
make test_migration

Documentation

  • Processing algorithms documentation can be generated with:
make processing-doc
  • HTML pages from repository markdown files, located in the docs/userguide directory. After editing the markdown files, use:
make github-pages
  • PostgreSQL database structure with SchemaSpy
make schemaspy
  • The documentation index page must be written by hand by editing the file docs/index.html.

Contributors

  • Michaël Douchin (3liz) @mdouchin
  • Etienne Trimmaille @Gustry

Funding

Licence

GPL V2