db_mirror
Change this workspace's read-only platform-data mirror (views in schema dialogbrain_v1 of its own database, read with db.query). action=enable migrates the mirror schemas and takes a full snapshot (needs a database from db.create; admin/owner only). It is NOT idempotent: every call re-migrates and re-snapshots, so it is also how a failed mirror is recovered. The work runs in the background and the call returns at once with status 'snapshotting'; poll db.mirror_status until it is healthy. action=resync reconciles with the platform now (admin/owner, only when enabled and not snapshotting; also runs in the background). Example once healthy: db.query sql="SELECT id, title, last_message_preview FROM dialogbrain_v1.threads WHERE channel_account_id = AND last_message_is_outgoing = false".
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| action | Yes | enable | resync | |
| in_workspace | No | Run this one call in this workspace id instead of the session's. Nothing is stored; other sessions are not affected. |