Documentation

Configure synchronization and administer a tenant

A practical guide for integrators and administrators—from datasource setup to SQL validation and sync-session operations.

01 · Configuration

Synchronization scripts

Each sync_table_config record describes one logical mobile table. Its direction—download, upload or both—is derived from the configured SQL templates.

Recommended sequence

Create the configuration disabled, define keys and SQL, run Validate and Dry-run, then enable the table.

table_name

Unique table name used by the protocol and local SQLite.

primary_keys[]

Stable columns that uniquely identify a row.

enabled

Includes the table in new synchronization sessions.

parameter mappings

JSON arrays for insert, update and delete parameter mappings.

SQL fields

read_actual_sqlDownloads current rows changed during the sync window.
read_deleted_sqlReturns keys deleted from the central system.
insert_sqlCreates a row uploaded by the mobile client.
update_sqlApplies local changes to an existing server row.
delete_sqlDeletes or logically marks a server row.

02 · SQL templates

Placeholders and parameters

Values are never concatenated into SQL. The renderer replaces placeholders with bound parameters and handles NULL as an SQL literal.

Session values{{s.last_table_download}}{{s.to_ts}}{{s.username}}{{s.device_id}}
Record values{{r.id}}{{r.customer_id}}{{r.updated_at}}Columns available in the current upload record.
Download example
SELECT id, customer_id, total, updated_at
FROM sales_order
WHERE updated_at > {{s.last_table_download}}
  AND updated_at <= {{s.to_ts}}
Upload example
UPDATE sales_order
SET total = {{r.total}}, updated_at = {{r.updated_at}}
WHERE id = {{r.id}}

For a locally generated INTEGER AUTOINCREMENT key, enable calculate_client_pk, define the key column and range size, and provide a read-only read_client_pk_max_sql query returning one sequence_value column.

03 · Safe rollout

Validation, Dry-run and audit

  1. 1
    Validate

    Checks placeholders, mapping structure and SQL through the selected tenant adapter.

  2. 2
    Dry-run

    Run read templates with test user/device context, a time window and a limit of up to 500 rows.

  3. 3
    Inspect results

    Match columns to the mobile schema and verify keys, timestamp boundaries and data scope.

  4. 4
    Save and enable

    Audit History records the actor, timestamp, diff and snapshot for every change.

Never concatenate user input into SQL. Pass session and record values only through {{s.*}} and {{r.*}}.

04 · Tenant administration

Administering a tenant

A tenant isolates its datasource, users, API key, sync configuration and operational records. The current console gives superadmins global tenant management; tenant-scoped admin and viewer accounts remain inside their assigned tenant.

General and datasource

Configure name, slug, status, gRPC endpoint, invitation TTL and allowed database types. Then set driver, host, port, database, schema and credentials, and run Test Connection.

Users

Create tenant accounts with admin or viewer roles. Viewer is intended for read-only monitoring.

Mobile access

The tenant API key is shown only once at creation. Store it in a secret manager and onboard devices with expiring invitations.

Change control

Review configuration audit history, sync sessions, events, user state and queue. Datasource passwords are never returned by the API.

Initial setup checklist

  1. Create the tenant and save the one-time API key.
  2. Set the sync endpoint and invitation lifetime.
  3. Select an allowed driver and configure the datasource.
  4. Run Test Connection before creating sync configurations.
  5. Create admin/viewer accounts and a mobile invitation.
  6. Add, validate and progressively enable sync tables.

05 · Operations

Daily control

DashboardWatch failed sessions, disabled tables and queue problems.
SessionsInspect ordered events to identify the failed phase, table and error.
User StateReview access status and latest download/upload times by user and device.
QueueRetry failed uploads only after fixing the cause; viewer cannot retry.