File tree Expand file tree Collapse file tree 1 file changed +9
-1
lines changed
Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -35,7 +35,10 @@ so CloudSync can sync between a PostgreSQL server and SQLite clients.
3535
3636### 1) Primary Keys
3737
38- - Use ** TEXT NOT NULL** primary keys only (UUIDs as text).
38+ - Use ** TEXT NOT NULL** primary keys in SQLite.
39+ - PostgreSQL primary keys can be ** TEXT NOT NULL** or ** UUID** . If the PK type
40+ isn't explicitly mapped to a DBTYPE (like UUID), it will be converted to TEXT
41+ in the payload so it remains compatible with the SQLite extension.
3942- Generate IDs with ` cloudsync_uuid() ` on both sides.
4043- Avoid INTEGER auto-increment PKs.
4144
@@ -49,6 +52,11 @@ PostgreSQL:
4952id TEXT PRIMARY KEY NOT NULL
5053```
5154
55+ PostgreSQL (UUID):
56+ ``` sql
57+ id UUID PRIMARY KEY NOT NULL
58+ ```
59+
5260### 2) NOT NULL Columns Must Have DEFAULTs
5361
5462CloudSync merges column-by-column. Any NOT NULL (non-PK) column needs a DEFAULT
You can’t perform that action at this time.
0 commit comments