Skip to content

Commit de9ced8

Browse files
ecstatic-morsemichaelbarnes
authored andcommitted
Add a note explaining the consequences of ID aliases when uploading (#219)
1 parent e6ff803 commit de9ced8

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

usage/sync-rules/client-id.mdx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,10 @@ Custom transformations could also be used for the ID, for example:
2222
SELECT org_id || '.' || record_id as id FROM my_data
2323
```
2424

25+
<Warning>
26+
If you want to upload data to a table with a custom record ID, ensure that `uploadData()` isn't blindly using a field named `id` when handling CRUD operations. See the [Sequential ID mapping tutorial](/tutorials/client/data/sequential-id-mapping#update-client-to-use-uuids) for an example where the record ID is aliased to `uuid` on the backend.
27+
</Warning>
28+
2529
PowerSync does not perform any validation that IDs are unique. Duplicate IDs on a client could occur in any of these scenarios:
2630

2731
1. A non-unique column is used for the ID.

0 commit comments

Comments
 (0)