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.md
+31-2Lines changed: 31 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -11,7 +11,9 @@ Execute a full roundtrip sync test between a local SQLite database and the local
11
11
12
12
### Step 1: Get DDL from User
13
13
14
-
Ask the user to provide a DDL query for the table to test. It can be in PostgreSQL or SQLite format. Example:
14
+
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:
15
+
16
+
**Option 1: Simple TEXT primary key**
15
17
```sql
16
18
CREATETABLEtest_sync (
17
19
id TEXTPRIMARY KEYNOT NULL,
@@ -20,6 +22,33 @@ CREATE TABLE test_sync (
20
22
);
21
23
```
22
24
25
+
**Option 2: UUID primary key**
26
+
```sql
27
+
CREATETABLEtest_uuid (
28
+
id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
29
+
name TEXT,
30
+
created_at TIMESTAMPTZ DEFAULT NOW()
31
+
);
32
+
```
33
+
34
+
**Option 3: Two tables scenario (tests multi-table sync)**
35
+
```sql
36
+
CREATETABLEauthors (
37
+
id TEXTPRIMARY KEYNOT NULL,
38
+
name TEXT,
39
+
email TEXT
40
+
);
41
+
42
+
CREATETABLEbooks (
43
+
id TEXTPRIMARY KEYNOT NULL,
44
+
title TEXT,
45
+
author_id TEXT,
46
+
published_year INTEGER
47
+
);
48
+
```
49
+
50
+
**Note:** Avoid INTEGER PRIMARY KEY for sync tests as it is not recommended for distributed sync scenarios (conflicts with auto-increment across devices).
51
+
23
52
### Step 2: Convert DDL
24
53
25
54
Convert the provided DDL to both SQLite and PostgreSQL compatible formats if needed. Key differences:
@@ -32,7 +61,7 @@ Convert the provided DDL to both SQLite and PostgreSQL compatible formats if nee
32
61
33
62
Run the token script from the cloudsync project:
34
63
```bash
35
-
cd ../cloudsync && go run scripts/get_supabase_token.go -project-ref=supabase-local -email=andrea@sqlitecloud.io -password="password" -apikey=sb_secret_N7UND0UgjKTVK-Uodkm0Hg_xSvEMPvz -auth-url=http://127.0.0.1:54321
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
0 commit comments