Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.ilyama.golain.io/llms.txt

Use this file to discover all available pages before exploring further.

Configuration lives under the top-level sqlite-replication: key in client YAML, plus MQTT connection: settings.

Connection block

Required for sync — see topics and connection.
FieldNotes
transportMust be mqtt for production
server_url_envBroker URL (ssl://…:8883 or quic://…)
device_id_envDevice name — not UUID
root_topic_envPrefix for all sync topics
mqtt.clean_sessionfalse — required for downlink buffer
mqtt.tls.*_envmTLS cert paths
Optional JITR block under connection.jitr — see JITR enrollment.

sqlite-replication fields

FieldDefaultDescription
source_db_pathInline path (dev); use _env in prod
source_db_path_enve.g. OMEGA_SOURCE_DB_PATH
state_db_path{dataDir}/sqlite-replication/state.dbCursors, pause, buffer metadata
state_db_path_enve.g. OMEGA_STATE_DB_PATHset in production
flush_interval5sBatch flush tick
local_retention_bytes256 MiBDocumented; not fully enforced yet
table_strategiesall tables → rowsPer-table override — see capture strategies
snapshot_on_first_runfalseNot implemented — flag only

table_strategies example

sqlite-replication:
  source_db_path_env: OMEGA_SOURCE_DB_PATH
  flush_interval: 5s
  table_strategies:
    order_events:
      strategy: rows
    device_state:
      strategy: rows
    sensor_timeseries:
      strategy: rows    # use rows until telemetry flush ships
    sqlite_internal:
      strategy: ignore

Strategy values

StrategyBehavior
rowsTrigger journal → sync/rows/batch
telemetryCursor batches → sync/telemetry/batch (stub in Omega)
ignoreDo not replicate

Security capabilities

Enable module in security.capabilities:
security:
  capabilities:
    sqlite-replication: true
Signed control should stay enabled in production:
security:
  signed_control:
    enabled: true

Tables requirements

  • User tables must have explicit PRIMARY KEY (rowid-only tables are out of scope).
  • System tables (sqlite_*) and Omega internals (__omega_*) are excluded automatically.
  • After DDL migrations, restart Omega to reinstall triggers.

Persistent state (state.db)

Omega stores per table:
StatePurpose
last_published_commit_seqJournal cursor
journal_epochUUIDv7 — changes on journal reinit
schema_hash cacheDrift detection
Pause server_watermarkResume after downlink
Backpressure bufferRows held while paused
Loss of state.db without backup can cause duplicate publishes (server dedupes) or cursor confusion — treat as part of device backup strategy.

Validation

export OMEGA_AUTH_TOKEN=test
make validate-client CLIENT=my-device
make codegen CLIENT=my-device   # validate only, no build

Module discovery

Omega auto-enrolls all non-system tables when table_strategies omits a table (defaults to rows). Narrow with explicit ignore rules for scratch tables.