You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: .claude/commands/stress-test-sync-sqlitecloud.md
+18-11Lines changed: 18 additions & 11 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,17 +4,15 @@ Execute a stress test against the CloudSync server using multiple concurrent loc
4
4
5
5
## Prerequisites
6
6
- Connection string to a sqlitecloud project
7
-
- HTTP sync server running (default: https://cloudsync-staging-testing.fly.dev)
8
7
- Built cloudsync extension (`make` to build `dist/cloudsync.dylib`)
9
-
- CloudSync already enabled on the test table from the SQLiteCloud dashboard
10
8
11
9
## Test Configuration
12
10
13
11
### Step 1: Gather Parameters
14
12
15
13
Ask the user for the following configuration using a single question set:
16
14
17
-
1.**Sync Server URL** — propose `https://cloudsync-staging-testing.fly.dev` as default
15
+
1.**CloudSync server address** — propose `https://cloudsync.sqlite.ai` as default (this is the built-in default). If the user provides a different address, save it as `CUSTOM_ADDRESS` and use `cloudsync_network_init_custom` instead of `cloudsync_network_init`.
18
16
2.**SQLiteCloud connection string** — format: `sqlitecloud://<host>:<port>/<db_name>?apikey=<apikey>`. If no `<db_name>` is in the path, ask the user for one or propose `test_stress_sync`.
-`ITERATIONS` (number of delete/insert/update cycles)
41
36
-`NUM_DBS` (number of concurrent databases)
@@ -59,7 +54,19 @@ Connect to SQLiteCloud using `~/go/bin/sqlc` (last command must be `quit`). Note
59
54
```
60
55
7. Ask the user to enable CloudSync on the table from the SQLiteCloud dashboard
61
56
62
-
### Step 3: Get Auth Tokens (if RLS enabled)
57
+
### Step 3: Get Managed Database ID
58
+
59
+
Now that the database and tables are created and CloudSync is enabled on the dashboard, ask the user for:
60
+
61
+
1.**Managed Database ID** — the `managedDatabaseId` returned by the CloudSync service. For SQLiteCloud projects, it can be obtained from the project's OffSync page on the dashboard after enabling CloudSync on the table.
62
+
63
+
Save as `MANAGED_DB_ID`.
64
+
65
+
For the network init call throughout the test, use:
Create tokens for the test users. Create as many users as needed for the number of concurrent databases (assign 2 databases per user, or 1 per user if NUM_DBS <= 2).
65
72
@@ -75,7 +82,7 @@ Save each user's `token` and `userId` from the response.
75
82
76
83
If RLS is disabled, skip this step — tokens are not required.
77
84
78
-
### Step 4: Run the Concurrent Stress Test
85
+
### Step 5: Run the Concurrent Stress Test
79
86
80
87
Create a bash script at `/tmp/stress_test_concurrent.sh` that:
81
88
@@ -113,7 +120,7 @@ Create a bash script at `/tmp/stress_test_concurrent.sh` that:
113
120
114
121
Run the script with a 10-minute timeout.
115
122
116
-
### Step 5: Detailed Error Analysis
123
+
### Step 6: Detailed Error Analysis
117
124
118
125
After the test completes, provide a detailed breakdown:
119
126
@@ -122,7 +129,7 @@ After the test completes, provide a detailed breakdown:
122
129
3.**Timeline analysis**: do errors cluster at specific iterations or spread evenly?
123
130
4.**Read full log files** if errors are found — show the first and last 30 lines of each log with errors
124
131
125
-
### Step 6: Optional — Verify Data Integrity
132
+
### Step 7: Optional — Verify Data Integrity
126
133
127
134
If the test passes (or even if some errors occurred), verify the final state:
Copy file name to clipboardExpand all lines: .claude/commands/test-sync-roundtrip-sqlitecloud-rls.md
+24-12Lines changed: 24 additions & 12 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,12 +4,13 @@ Execute a full roundtrip sync test between multiple local SQLite databases and t
4
4
5
5
## Prerequisites
6
6
- Connection string to a sqlitecloud project
7
-
- HTTP sync server running (default: https://cloudsync-staging-testing.fly.dev)
8
7
- Built cloudsync extension (`make` to build `dist/cloudsync.dylib`)
9
8
10
-
### Step 1: Get Sync Server Address
9
+
### Step 1: Get CloudSync Parameters
11
10
12
-
Ask the user for the HTTP sync server base URL. Propose `https://cloudsync-staging-testing.fly.dev` as the default. Save this as `SYNC_SERVER_URL` for use throughout the test. The full sync endpoint will be `<SYNC_SERVER_URL>/<db_name>`.
11
+
Ask the user for:
12
+
13
+
1.**CloudSync server address** — propose `https://cloudsync.sqlite.ai` as default (this is the built-in default). If the user provides a different address, save it as `CUSTOM_ADDRESS` and use `cloudsync_network_init_custom` instead of `cloudsync_network_init`.
13
14
14
15
## Test Procedure
15
16
@@ -51,8 +52,7 @@ Ask the user to describe the policy in plain English.
51
52
52
53
### Step 4: Get sqlitecloud connection string from User
53
54
54
-
Ask the user to provide a connection string in the form of "sqlitecloud://<host>:<port>/<db_name>?apikey=<apikey>" to be later used with the sqlitecloud cli (sqlc) with `~/go/bin/sqlc "<connection_string>"`. Save the first subdomain in the connection string address as `PROJECT_ID` for use throughout the test. Use the "org_sqlitecloud" string as `ORG_ID`.
55
-
Save the configuration string `'{"address":"<SYNC_SERVER_URL>","database":"<db_name>","projectID":"<PROJECT_ID>","organizationID":"<ORG_ID>"}'` as `NETWORK_CONFIG` for use throughout the test.
55
+
Ask the user to provide a connection string in the form of "sqlitecloud://<host>:<port>/<db_name>?apikey=<apikey>" to be later used with the sqlitecloud cli (sqlc) with `~/go/bin/sqlc "<connection_string>"`.
56
56
57
57
### Step 5: Setup SQLiteCloud with RLS
58
58
@@ -104,7 +104,19 @@ Example for "user can only access their own rows":
104
104
-- DELETE: User can only delete rows they own
105
105
SET RLS DATABASE <db_name> TABLE <table_name>DELETE"auth_userid() = OLD.user_id"
106
106
```
107
-
8. Ask the user to enable the table from the sqlitecloud dashboard
107
+
8. Ask the user to enable CloudSync on the table from the SQLiteCloud dashboard
108
+
109
+
### Step 5b: Get Managed Database ID
110
+
111
+
Now that the database and tables are created and CloudSync is enabled on the dashboard, ask the user for:
112
+
113
+
1.**Managed Database ID** — the `managedDatabaseId` returned by the CloudSync service. For SQLiteCloud projects, it can be obtained from the project's OffSync page on the dashboard after enabling CloudSync on the table.
114
+
115
+
Save as `MANAGED_DB_ID`.
116
+
117
+
For the network init call throughout the test, use:
SELECT cloudsync_network_init('<MANAGED_DB_ID>');-- or cloudsync_network_init_custom('<CUSTOM_ADDRESS>', '<MANAGED_DB_ID>') if using a non-default address
SELECT cloudsync_network_init('<MANAGED_DB_ID>');-- or cloudsync_network_init_custom('<CUSTOM_ADDRESS>', '<MANAGED_DB_ID>') if using a non-default address
SELECT cloudsync_network_init('<MANAGED_DB_ID>');-- or cloudsync_network_init_custom('<CUSTOM_ADDRESS>', '<MANAGED_DB_ID>') if using a non-default address
SELECT cloudsync_network_init('<MANAGED_DB_ID>');-- or cloudsync_network_init_custom('<CUSTOM_ADDRESS>', '<MANAGED_DB_ID>') if using a non-default address
SELECT cloudsync_network_init('<MANAGED_DB_ID>');-- or cloudsync_network_init_custom('<CUSTOM_ADDRESS>', '<MANAGED_DB_ID>') if using a non-default address
421
433
SELECT cloudsync_network_set_token('...');
422
434
-- Session 2:
423
435
SELECT cloudsync_network_send_changes(); -- ERROR: No URL set
424
436
425
437
-- CORRECT: All network operations in the same session
SELECT cloudsync_network_init('<MANAGED_DB_ID>');-- or cloudsync_network_init_custom('<CUSTOM_ADDRESS>', '<MANAGED_DB_ID>') if using a non-default address
Copy file name to clipboardExpand all lines: .claude/commands/test-sync-roundtrip-supabase-rls.md
+17-8Lines changed: 17 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,7 +4,6 @@ Execute a full roundtrip sync test between multiple local SQLite databases and t
4
4
5
5
## Prerequisites
6
6
- Supabase instance running (local Docker or remote)
7
-
- HTTP sync server running (default: https://cloudsync-staging-testing.fly.dev)
8
7
- Built cloudsync extension (`make` to build `dist/cloudsync.dylib`)
9
8
10
9
## Test Procedure
@@ -13,7 +12,7 @@ Execute a full roundtrip sync test between multiple local SQLite databases and t
13
12
14
13
Ask the user for the following parameters:
15
14
16
-
1.**Sync server URL**: Propose `https://cloudsync-staging-testing.fly.dev` as default. Save as `SYNC_SERVER_URL`. The full sync endpoint will be `<SYNC_SERVER_URL>/postgres`.
15
+
1.**CloudSync server address** — propose `https://cloudsync.sqlite.ai` as default (this is the built-in default). If the user provides a different address, save it as `CUSTOM_ADDRESS` and use `cloudsync_network_init_custom` instead of `cloudsync_network_init`.
17
16
18
17
2.**PostgreSQL connection string**: Propose `postgresql://supabase_admin:postgres@127.0.0.1:54322/postgres` as default. Save as `PG_CONN`. Use this for all `psql` connections throughout the test.
SELECT cloudsync_network_init('<MANAGED_DB_ID>');-- or cloudsync_network_init_custom('<CUSTOM_ADDRESS>', '<MANAGED_DB_ID>') if using a non-default address
SELECT cloudsync_network_init('<MANAGED_DB_ID>');-- or cloudsync_network_init_custom('<CUSTOM_ADDRESS>', '<MANAGED_DB_ID>') if using a non-default address
SELECT cloudsync_network_init('<MANAGED_DB_ID>');-- or cloudsync_network_init_custom('<CUSTOM_ADDRESS>', '<MANAGED_DB_ID>') if using a non-default address
SELECT cloudsync_network_init('<MANAGED_DB_ID>');-- or cloudsync_network_init_custom('<CUSTOM_ADDRESS>', '<MANAGED_DB_ID>') if using a non-default address
SELECT cloudsync_network_init('<MANAGED_DB_ID>');-- or cloudsync_network_init_custom('<CUSTOM_ADDRESS>', '<MANAGED_DB_ID>') if using a non-default address
489
498
SELECT cloudsync_network_set_token('...');
490
499
-- Session 2:
491
500
SELECT cloudsync_network_send_changes(); -- ERROR: No URL set
492
501
493
502
-- CORRECT: All network operations in the same session
SELECT cloudsync_network_init('<MANAGED_DB_ID>');-- or cloudsync_network_init_custom('<CUSTOM_ADDRESS>', '<MANAGED_DB_ID>') if using a non-default address
Copy file name to clipboardExpand all lines: .claude/commands/test-sync-roundtrip-supabase.md
+13-3Lines changed: 13 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,7 +4,6 @@ Execute a full roundtrip sync test between a local SQLite database and the local
4
4
5
5
## Prerequisites
6
6
- Supabase instance running (local Docker or remote)
7
-
- HTTP sync server running (default: https://cloudsync-staging-testing.fly.dev)
8
7
- Built cloudsync extension (`make` to build `dist/cloudsync.dylib`)
9
8
10
9
## Test Procedure
@@ -13,14 +12,15 @@ Execute a full roundtrip sync test between a local SQLite database and the local
13
12
14
13
Ask the user for the following parameters:
15
14
16
-
1.**Sync server URL**: Propose `https://cloudsync-staging-testing.fly.dev` as default. Save as `SYNC_SERVER_URL`. The full sync endpoint will be `<SYNC_SERVER_URL>/postgres`.
15
+
1.**CloudSync server address** — propose `https://cloudsync.sqlite.ai` as default (this is the built-in default). If the user provides a different address, save it as `CUSTOM_ADDRESS` and use `cloudsync_network_init_custom` instead of `cloudsync_network_init`.
17
16
18
17
2.**PostgreSQL connection string**: Propose `postgresql://supabase_admin:postgres@127.0.0.1:54322/postgres` as default. Save as `PG_CONN`. Use this for all `psql` connections throughout the test.
19
18
20
19
3.**Supabase API key** (used for JWT token generation): Propose `sb_secret_N7UND0UgjKTVK-Uodkm0Hg_xSvEMPvz` as default. Save as `SUPABASE_APIKEY`.
21
20
22
21
Derive `AUTH_URL` from the PostgreSQL connection string by extracting the host and using port `54321` (Supabase GoTrue). For example, if `PG_CONN` is `postgresql://user:pass@10.0.0.5:54322/postgres`, then `AUTH_URL` is `http://10.0.0.5:54321`. For `127.0.0.1`, use `http://127.0.0.1:54321`.
23
22
23
+
24
24
### Step 2: Get DDL from User
25
25
26
26
Ask the user to provide a DDL query for the table(s) to test. It can be in PostgreSQL or SQLite format. Offer the following options:
SELECT cloudsync_network_init('<MANAGED_DB_ID>');-- or cloudsync_network_init_custom('<CUSTOM_ADDRESS>', '<MANAGED_DB_ID>') if using a non-default address
**Description:** Initializes the `sqlite-sync` network component. This function parses the connection string to configure change checking and upload endpoints, and initializes the cURL library.
292
+
**Description:** Initializes the `sqlite-sync` network component. This function configures the endpoints for the CloudSync service and initializes the cURL library.
293
293
294
294
**Parameters:**
295
295
296
-
-`connection_string` (TEXT): The connection string for the remote synchronization server. The format is `sqlitecloud://<host>:<port>/<database>?<options>`.
296
+
-`managedDatabaseId` (TEXT): The managed database identifier returned by the CloudSync service when a new database is registered for sync. For SQLiteCloud projects, this value can be obtained from the project's OffSync page on the dashboard.
Copy file name to clipboardExpand all lines: CHANGELOG.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -13,7 +13,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
13
13
14
14
### Changed
15
15
16
-
-**BREAKING: `cloudsync_network_init` now accepts JSON instead of a URL string.** The new format adds `projectID` and `organizationID` fields for multi-organization CloudSync support. An `X-CloudSync-Org` header is automatically sent with every request.
16
+
-**BREAKING: `cloudsync_network_init` now accepts a `managedDatabaseId`instead of a connection string.** The `managedDatabaseId` is returned by the CloudSync service when a new database is registered for sync. For SQLiteCloud projects, it can be obtained from the project's OffSync page on the dashboard.
17
17
18
18
Before:
19
19
```sql
@@ -22,7 +22,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
-**BREAKING: Sync functions now return structured JSON.**`cloudsync_network_send_changes`, `cloudsync_network_check_changes`, and `cloudsync_network_sync` return a JSON object instead of a plain integer. This provides richer status information including sync state, version numbers, row counts, and affected table names.
0 commit comments