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/test-sync-roundtrip-sqlitecloud-rls.md
+18-14Lines changed: 18 additions & 14 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,9 +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 on http://localhost:8091/<dbname>
7
+
- HTTP sync server running (default: https://cloudsync-staging-testing.fly.dev)
8
8
- Built cloudsync extension (`make` to build `dist/cloudsync.dylib`)
9
9
10
+
### Step 0: Get Sync Server Address
11
+
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>`.
13
+
10
14
## Test Procedure
11
15
12
16
### Step 1: Get DDL from User
@@ -61,7 +65,7 @@ Ask the user to describe the policy in plain English.
61
65
62
66
### Step 3: Get sqlitecloud connection string from User
63
67
64
-
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>"`
68
+
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. Save the configuration string `'{"address":"<SYNC_SERVER_URL>","database":"<db_name>","projectID":"<PROJECT_ID>","organizationID":"org_sqlitecloud"}'` as `NETWORK_CONFIG` for use throughout the test.
Copy file name to clipboardExpand all lines: .claude/commands/test-sync-roundtrip-supabase-rls.md
+25-13Lines changed: 25 additions & 13 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -3,12 +3,24 @@
3
3
Execute a full roundtrip sync test between multiple local SQLite databases and the local Supabase Docker PostgreSQL instance, verifying that Row Level Security (RLS) policies are correctly enforced during sync.
4
4
5
5
## Prerequisites
6
-
- Supabase Docker container running (PostgreSQL on port 54322)
7
-
- HTTP sync server running on http://localhost:8091/postgres
6
+
- Supabase instance running (local Docker or remote)
7
+
- HTTP sync server running (default: https://cloudsync-staging-testing.fly.dev)
8
8
- Built cloudsync extension (`make` to build `dist/cloudsync.dylib`)
9
9
10
10
## Test Procedure
11
11
12
+
### Step 0: Get Connection Parameters
13
+
14
+
Ask the user for the following parameters:
15
+
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`.
17
+
18
+
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
+
20
+
3.**Supabase API key** (used for JWT token generation): Propose `sb_secret_N7UND0UgjKTVK-Uodkm0Hg_xSvEMPvz` as default. Save as `SUPABASE_APIKEY`.
21
+
22
+
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
+
12
24
### Step 1: Get DDL from User
13
25
14
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:
@@ -79,7 +91,7 @@ Convert the provided DDL to both SQLite and PostgreSQL compatible formats if nee
79
91
80
92
Connect to Supabase PostgreSQL and prepare the environment:
@@ -148,13 +160,13 @@ Get JWT tokens for both test users by running the token script twice:
148
160
149
161
**User 1: claude1@sqlitecloud.io**
150
162
```bash
151
-
cd ../cloudsync && go run scripts/get_supabase_token.go -project-ref=supabase-local -email=claude1@sqlitecloud.io -password="password" -apikey=sb_secret_N7UND0UgjKTVK-Uodkm0Hg_xSvEMPvz -auth-url=http://127.0.0.1:54321
163
+
cd ../cloudsync && go run scripts/get_supabase_token.go -project-ref=supabase-local -email=claude1@sqlitecloud.io -password="password" -apikey=<SUPABASE_APIKEY> -auth-url=<AUTH_URL>
152
164
```
153
165
Save as `JWT_USER1`.
154
166
155
167
**User 2: claude2@sqlitecloud.io**
156
168
```bash
157
-
cd ../cloudsync && go run scripts/get_supabase_token.go -project-ref=supabase-local -email=claude2@sqlitecloud.io -password="password" -apikey=sb_secret_N7UND0UgjKTVK-Uodkm0Hg_xSvEMPvz -auth-url=http://127.0.0.1:54321
169
+
cd ../cloudsync && go run scripts/get_supabase_token.go -project-ref=supabase-local -email=claude2@sqlitecloud.io -password="password" -apikey=<SUPABASE_APIKEY> -auth-url=<AUTH_URL>
158
170
```
159
171
Save as `JWT_USER2`.
160
172
@@ -167,7 +179,7 @@ Also extract the user IDs from the JWT tokens (the `sub` claim) for use in INSER
167
179
Create four temporary SQLite databases using the Homebrew version (IMPORTANT: system sqlite3 cannot load extensions):
Copy file name to clipboardExpand all lines: .claude/commands/test-sync-roundtrip-supabase.md
+19-7Lines changed: 19 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -3,12 +3,24 @@
3
3
Execute a full roundtrip sync test between a local SQLite database and the local Supabase Docker PostgreSQL instance.
4
4
5
5
## Prerequisites
6
-
- Supabase Docker container running (PostgreSQL on port 54322)
7
-
- HTTP sync server running on http://localhost:8091/postgres
6
+
- Supabase instance running (local Docker or remote)
7
+
- HTTP sync server running (default: https://cloudsync-staging-testing.fly.dev)
8
8
- Built cloudsync extension (`make` to build `dist/cloudsync.dylib`)
9
9
10
10
## Test Procedure
11
11
12
+
### Step 0: Get Connection Parameters
13
+
14
+
Ask the user for the following parameters:
15
+
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`.
17
+
18
+
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
+
20
+
3.**Supabase API key** (used for JWT token generation): Propose `sb_secret_N7UND0UgjKTVK-Uodkm0Hg_xSvEMPvz` as default. Save as `SUPABASE_APIKEY`.
21
+
22
+
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
+
12
24
### Step 1: Get DDL from User
13
25
14
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:
@@ -61,15 +73,15 @@ Convert the provided DDL to both SQLite and PostgreSQL compatible formats if nee
61
73
62
74
Run the token script from the cloudsync project:
63
75
```bash
64
-
cd ../cloudsync && go run scripts/get_supabase_token.go -project-ref=supabase-local -email=claude@sqlitecloud.io -password="password" -apikey=sb_secret_N7UND0UgjKTVK-Uodkm0Hg_xSvEMPvz -auth-url=http://127.0.0.1:54321
76
+
cd ../cloudsync && go run scripts/get_supabase_token.go -project-ref=supabase-local -email=claude@sqlitecloud.io -password="password" -apikey=<SUPABASE_APIKEY> -auth-url=<AUTH_URL>
65
77
```
66
78
Save the JWT token for later use.
67
79
68
80
### Step 4: Setup PostgreSQL
69
81
70
82
Connect to Supabase PostgreSQL and prepare the environment:
0 commit comments