Skip to content

Commit 1c2446c

Browse files
committed
Update README.md
1 parent bd65ec0 commit 1c2446c

1 file changed

Lines changed: 20 additions & 3 deletions

File tree

test/sync/README.md

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,9 +59,26 @@ The sync layer routes changes through a [SQLiteCloud](https://sqlitecloud.io/) m
5959

6060
1. **Create an account** at [https://sqlite.ai/](https://sqlite.ai/) and create a project.
6161
2. **Create a database** in the [dashboard](https://dashboard.sqlitecloud.io/).
62-
3. **Enable OffSync** for the database: open the database, click **OffSync**, and enable synchronization. This provisions the CloudSync microservice that routes changes between agents.
63-
4. **Copy the managed database ID** — shown on the OffSync page (format: `db_xxxxxxxxxxxx`).
64-
5. **Create API keys** — one per agent is recommended, so access can be revoked independently. API keys are created in the dashboard under **API Keys**.
62+
3. **Create the memory table** — connect to your database and run:
63+
```sql
64+
CREATE TABLE IF NOT EXISTS dbmem_content (
65+
hash INTEGER PRIMARY KEY NOT NULL,
66+
path TEXT NOT NULL DEFAULT '' UNIQUE,
67+
value TEXT DEFAULT NULL,
68+
length INTEGER NOT NULL DEFAULT 0,
69+
context TEXT DEFAULT NULL,
70+
created_at INTEGER DEFAULT 0,
71+
last_accessed INTEGER DEFAULT 0
72+
);
73+
```
74+
4. **Enable OffSync** for the database: open the database, click **OffSync**, and enable synchronization. This provisions the CloudSync microservice that routes changes between agents.
75+
5. **Enable OffSync for the table** — initialize sync on `dbmem_content` and configure the `value` column to use block-level LWW so that concurrent agent edits to different lines of the same entry are preserved rather than overwritten. This can be done from the dashboard UI (Database → OffSync section) or via SQL:
76+
```sql
77+
SELECT cloudsync_init('dbmem_content', 'cls', 1);
78+
SELECT cloudsync_set_column('dbmem_content', 'value', 'algo', 'block');
79+
```
80+
6. **Copy the managed database ID** — shown on the OffSync page (format: `db_xxxxxxxxxxxx`).
81+
7. **Create API keys** — one per agent is recommended, so access can be revoked independently. API keys are created in the dashboard under **API Keys**.
6582

6683
### Credentials used by the test
6784

0 commit comments

Comments
 (0)