Commit 8d6442e
Fix sql-compiler to handle empty strings like
* Fix empty string being incorrectly treated as NULL in queries
The sql-compiler was filtering out empty strings from query params,
treating them the same as null/undefined values. This caused queries
like `eq(column, '')` to incorrectly generate `WHERE column = NULL`
instead of `WHERE column = ''`.
The fix changes the filter condition to check the original value for
null/undefined instead of checking if the serialized value is an
empty string. This allows legitimate empty string queries to work
correctly while still properly omitting null/undefined params.
* ci: apply automated fixes
* Simplify null/undefined check to idiomatic pattern
Co-Authored-By: Claude Opus 4.5 <[email protected]>
* Add regression tests for issue #1147
Co-Authored-By: Claude Opus 4.5 <[email protected]>
* Add like/ilike empty string tests for defense-in-depth
Co-Authored-By: Claude Opus 4.5 <[email protected]>
* Remove duplicate empty string test
Co-Authored-By: Claude Opus 4.5 <[email protected]>
* Add changeset for empty string fix
Co-Authored-By: Claude Opus 4.5 <[email protected]>
---------
Co-authored-by: Claude <[email protected]>
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>eq(column, '') (#1146)1 parent f32246a commit 8d6442e
File tree
4 files changed
+59
-4
lines changed- .changeset
- packages
- electric-db-collection
- src
- tests
- vue-db/tests
4 files changed
+59
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
38 | 38 | | |
39 | 39 | | |
40 | 40 | | |
41 | | - | |
42 | | - | |
43 | | - | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
44 | 44 | | |
45 | 45 | | |
46 | 46 | | |
| |||
Lines changed: 48 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
68 | 68 | | |
69 | 69 | | |
70 | 70 | | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
71 | 119 | | |
72 | 120 | | |
73 | 121 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
132 | 132 | | |
133 | 133 | | |
134 | 134 | | |
135 | | - | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
136 | 138 | | |
137 | 139 | | |
0 commit comments