feat(sync-service): add Postgres concat(VARIADIC text) to shape subset eval#4281
feat(sync-service): add Postgres concat(VARIADIC text) to shape subset eval#4281abegehr wants to merge 5 commits intoelectric-sql:mainfrom
Conversation
…t eval Register concat with NULL-skipping semantics (empty string when all args are NULL), matching text concat behavior distinct from || with NULL. Tests cover literals, refs, ilike(concat(...)), contrast with ||, and document that concat() is unsupported (no concat/0 overload).
Enhance SQL generator to support variadic concat function, allowing concatenation of multiple elements wrapped in an array. Update tests to verify the correct SQL output for concat with array arguments, ensuring compatibility with existing functionality.
robacourt
left a comment
There was a problem hiding this comment.
Looking good! Please could you add some tests for some of the other edge cases mentioned here: https://chatgpt.com/share/69fb490a-4c2c-8327-a6a2-74f730c95ea9 e.g. date types, variadic arrays, char(n). It's fine to just return an error when parsing so that we don't support them, but if we do parse then successfully we should handle these cases correctly.
Add tests to improve error handling for the concat function in the SQL parser. Specifically, reject concat with non-text date arguments, keep explicit variadic concat array forms unsupported, and reject concat with char(n) until bpchar support is implemented. These changes ensure better validation and user feedback for unsupported operations.
|
added three more tests for edge-cases |
✅ Deploy Preview for electric-next ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
Codecov Report✅ All modified and coverable lines are covered by tests.
Additional details and impacted files@@ Coverage Diff @@
## main #4281 +/- ##
==========================================
- Coverage 63.06% 55.60% -7.47%
==========================================
Files 184 233 +49
Lines 19932 22380 +2448
Branches 4956 5850 +894
==========================================
- Hits 12571 12444 -127
- Misses 7358 9930 +2572
- Partials 3 6 +3
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Register concat with NULL-skipping semantics (empty string when all args are NULL), matching text concat behavior distinct from || with NULL.
Tests cover literals, refs, ilike(concat(...)), contrast with ||, and document that concat() is unsupported (no concat/0 overload).