Skip to main content
Golain does not blindly copy SQLite schemas. Every table’s schema fingerprint is hashed, classified, and — when required — reviewed by an operator before data becomes queryable product storage.

Schema fingerprint

Before each batch, the edge agent builds canonical JSON from PRAGMA table_info:
Rules:
  • Columns sorted by name (not table ordinal).
  • Types mapped to SQLite affinity classes (INTEGER, TEXT, REAL, BLOB, NUMERIC).
  • pk_ordinal: 0 for non-PK columns; 1..N for composite PK members.
  • Indexes, triggers, FKs, defaults — excluded from fingerprint.
Hash: canonical JSON (sorted keys, no whitespace) → SHA-256 → lowercase 64-char hex = schema_hash. Column reorder does not change the hash. Adding/removing columns, changing types, or PK membership does. → Integrator detail: Payload formats — schema observation

Classification

When a batch arrives with a hash the cloud has not accepted for this lineage: Production default: allow_additive_continue=false → first insert to a new table always hits ambiguous.

Schema observation (advisory)

Devices may publish sync/schema/observe when hash changes:
Observations warm server-side registry metadata. They do not replace the need for a data batch to trigger classification.

Schema review states

Permission for claim/approve/reject: PROJECT_CAN_MANAGE_DEVICES.

Column actions (approve)

When approving, specify one action per source column: Example approve body:
All mutations require header Idempotency-Key. → Step-by-step: Schema review workflow

What the device does during review

The edge agent does not wait for review completion:
  1. Keeps publishing batches with the new schema_hash.
  2. Cloud stages rows while lineage is paused for review.
  3. After approve, cloud replays staged rows into mirror.
If the server sends pause_lineage (backpressure, not review alone), the device must ACK and buffer locally. Downlink control

Schema drift on device

When application migrations alter SQLite DDL:
  1. Edge recomputes fingerprint on next flush.
  2. Optional sync/schema/observe publish.
  3. Next batch includes new hash → cloud re-classifies.
Reinstall triggers after DDL on enrolled tables (Omega does this on module restart).

Events (audit / automation)

Governance emits integration events (for SSE, workflows):
  • integration.edge_schema_review.queued|approved|rejected|abandoned.v1
  • integration.edge_table_lineage.ingestion_paused|ingestion_resumed.v1
  • integration.edge_export_segment.materialized|materialization_failed.v1
Subscribe via project event stream: platform-tui events watch.