diff --git a/.github/vale/config/vocabularies/PowerSync/accept.txt b/.github/vale/config/vocabularies/PowerSync/accept.txt index 024557270..991997fce 100644 --- a/.github/vale/config/vocabularies/PowerSync/accept.txt +++ b/.github/vale/config/vocabularies/PowerSync/accept.txt @@ -10,6 +10,7 @@ backpressure baz binlog bitwise +booleans bundler bundlers cardinalities diff --git a/sync/advanced/compatibility.mdx b/sync/advanced/compatibility.mdx index b5f114045..d0d1a3c3e 100644 --- a/sync/advanced/compatibility.mdx +++ b/sync/advanced/compatibility.mdx @@ -105,7 +105,8 @@ This table lists all fixes currently supported: | `versioned_bucket_ids` | [Link](#versioned_bucket_ids) | 1.15.0 | 2 | | `fixed_json_extract` | [Link](#fixed_json_extract) | 1.15.0 | 2 | | `custom_postgres_types` | [Link](#custom_postgres_types) | 1.15.3 | 2 | -| `unstable_sqlite_expression_engine` | [Link](#unstable_sqlite_expression_engine). | 1.22.0 | None (unstable) | +| `fixed_booleans_in_json` | [Link](#fixed_booleans_in_json) | 1.27.0 | None | +| `unstable_sqlite_expression_engine` | [Link](#unstable_sqlite_expression_engine) | 1.22.0 | None (unstable) | ### `timestamps_iso8601` @@ -180,6 +181,17 @@ With this fix applied: ``` - Multi-ranges sync as an array of ranges. +### `fixed_booleans_in_json` + +Most source databases supported by PowerSync have a dedicated type for boolean values. SQLite does not. It represents booleans as the integers `0` and `1` by convention. For boolean columns, PowerSync correctly translates values to integers. + +Booleans can also appear in nested structures, e.g. in JSON objects or arrays, or plain Postgres composite types, ranges and arrays. These are synced as JSON, which supports boolean literals. Without this option, the Service maps boolean values embedded in such structures to integers. + +Enabling this option makes the Service preserve booleans in JSON structures. For instance, a MongoDB document field `settings: { notifications: true }` syncs as: + +- `{"notifications":1}` with the option disabled. +- `{"notifications":true}` with the option enabled. + ### `unstable_sqlite_expression_engine`