Skip to content

Conversation

@KyleAMathews
Copy link
Contributor

@KyleAMathews KyleAMathews commented Dec 18, 2025

Builds on TanStack/db#1042

Add support for structured expressions in subset queries to enable proper columnMapper transformations for column names. This enables TanStack DB to send structured expression data alongside compiled SQL strings.

Changes:

  • Add SerializedExpression and SerializedOrderByClause types
  • Add compileExpression() and compileOrderBy() functions for expression compilation
  • Update SubsetParams to include whereExpr and orderByExpr fields
  • Update client to prefer structured expressions when available
  • Add new query params: subset__where_expr, subset__order_by_expr

When structured expressions are provided, the client compiles them with columnMapper applied, allowing transformations like camelCase → snake_case to work correctly for subset queries.

…yExpr)

Add support for structured expressions in subset queries to enable proper
columnMapper transformations for column names. This enables TanStack DB
to send structured expression data alongside compiled SQL strings.

Changes:
- Add SerializedExpression and SerializedOrderByClause types
- Add compileExpression() and compileOrderBy() functions for expression compilation
- Update SubsetParams to include whereExpr and orderByExpr fields
- Update client to prefer structured expressions when available
- Add new query params: subset__where_expr, subset__order_by_expr

When structured expressions are provided, the client compiles them with
columnMapper applied, allowing transformations like camelCase → snake_case
to work correctly for subset queries.
@pkg-pr-new
Copy link

pkg-pr-new bot commented Dec 18, 2025

Open in StackBlitz

npm i https://pkg.pr.new/@electric-sql/react@3629
npm i https://pkg.pr.new/@electric-sql/client@3629
npm i https://pkg.pr.new/@electric-sql/y-electric@3629

commit: 32939be

@codecov
Copy link

codecov bot commented Dec 18, 2025

Codecov Report

❌ Patch coverage is 88.60759% with 9 lines in your changes missing coverage. Please review.
✅ Project coverage is 87.81%. Comparing base (a7b6094) to head (32939be).
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
packages/typescript-client/src/client.ts 50.00% 6 Missing ⚠️
...kages/typescript-client/src/expression-compiler.ts 95.38% 3 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3629      +/-   ##
==========================================
+ Coverage   87.79%   87.81%   +0.02%     
==========================================
  Files          18       19       +1     
  Lines        1663     1740      +77     
  Branches      415      458      +43     
==========================================
+ Hits         1460     1528      +68     
- Misses        201      210       +9     
  Partials        2        2              
Flag Coverage Δ
packages/experimental 87.73% <ø> (ø)
packages/react-hooks 86.48% <ø> (ø)
packages/typescript-client 93.43% <88.60%> (-0.33%) ⬇️
packages/y-electric 56.05% <ø> (ø)
typescript 87.81% <88.60%> (+0.02%) ⬆️
unit-tests 87.81% <88.60%> (+0.02%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@blacksmith-sh

This comment has been minimized.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants