Skip to content
Source
Sign inSign up
TanStack/db

fix(electric-db-collection): preserve PostgreSQL query semantics #1832

MergedKyleAMathews(GitHub profile, opens in a new tab)merged 7 commits intomain fromrefs/pull/1832/headmerged by KyleAMathews(GitHub profile, opens in a new tab)

Showing 5 changed files with 176 additions and 1 deletion (loading 2).

x
0 of 5 viewed, 5 left
8 additions and 0 deletions.changeset/fix-electric-sql-semantics.mdAdded
View file
@@ -0,0 +1,8 @@
+---
+'@tanstack/electric-db-collection': patch
+---
+​
+Preserve PostgreSQL semantics for boolean comparisons and array membership,
+including nullable values, compatible reference-to-array types, and non-text
+array elements. Reject nullish membership operands and literal-array left
+operands, and escape quotes in mapped column names.
56 additions and 1 deletionpackages/electric-db-collection/e2e/sql-predicate-semantics.e2e.test.tsModified
View file
@@ -265,7 +265,15 @@
await client.query(`SET search_path TO ${inject(`testSchema`)}`)
table = `predicate_semantics_${Date.now().toString(16)}`
await client.query(
- `CREATE TABLE "${table}" (id INTEGER PRIMARY KEY, count INTEGER, label TEXT, enabled BOOLEAN)`,
+ `CREATE TABLE "${table}" (
+ id INTEGER PRIMARY KEY,
+ count INTEGER,
+ label TEXT,
+ enabled BOOLEAN,
+ roles TEXT[],
+ integer_roles INTEGER[],
+ required_role VARCHAR(16)
+ )`,