PowerSync is compatible with more advanced types such as arrays and JSON.
trackPreviousValues
(or trackPrevious
in our JS SDKs): Access previous values for diffing custom types, arrays, or JSON fields. Accessible later via CrudEntry.previousValues
.trackMetadata
: Adds a _metadata
column for storing custom metadata. Value of the column is accessible later via CrudEntry.metadata
.ignoreEmptyUpdates
: Skips updates when no data has actually changed.location_address
, as defined above, would be synced to clients as the following string:
("1000 S Colorado Blvd.",Denver,CO,80211)
It is not currently possible to extract fields from custom types in Sync Rules, so the entire column must be synced as text.
text
column in your client-side schema definition. For advanced update tracking, see Advanced Schema Options.
trackPreviousValues
enabled, compare the previous and new values to process only the changes you care about:
["00000000-0000-0000-0000-000000000000", "12345678-1234-1234-1234-123456789012"]
Array Membership
It’s possible to sync rows dynamically based on the contents of array columns using the IN
operator. For example:
IN
operator: Operatorstext
column in your client-side schema definition. For advanced update tracking, see Advanced Schema Options.
trackPreviousValues
enabled, compare the previous and new values to process only the changes you care about:
jsonDecode
in the connector’s uploadData
function. The default implementation of uploadData
does not handle complex types like arrays automatically.json_extract()
.
text
column in your client-side schema definition. For advanced update tracking, see Advanced Schema Options.
trackPreviousValues
enabled, compare the previous and new values to process only the changes you care about: