-
Notifications
You must be signed in to change notification settings - Fork 158
Add debug logging and tests for columnMapper.encode in loadSubset #1176
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Adds two tests to verify that columnMapper.encode is properly applied when compiling WHERE clauses for loadSubset requests: 1. When columnMapper.encode is configured, column names in WHERE clauses are transformed (e.g., isArchived → is_archived) 2. When no columnMapper is provided, column names are preserved as-is This helps verify the fix from PR #1141 that added columnMapper support to SQL compilation for subset queries.
Adds debug logging to help diagnose when columnMapper encoding is or isn't being applied to WHERE clauses in loadSubset requests. Logs: - Whether columnMapper.encode is configured when createLoadSubsetDedupe runs - The compiled WHERE clause before it's sent to the server Enable debugging with: DEBUG=ts/db:electric
|
More templates
@tanstack/angular-db
@tanstack/db
@tanstack/db-ivm
@tanstack/electric-db-collection
@tanstack/offline-transactions
@tanstack/powersync-db-collection
@tanstack/query-db-collection
@tanstack/react-db
@tanstack/rxdb-db-collection
@tanstack/solid-db
@tanstack/svelte-db
@tanstack/trailbase-db-collection
@tanstack/vue-db
commit: |
|
Size Change: 0 B Total Size: 90.9 kB ℹ️ View Unchanged
|
|
Size Change: 0 B Total Size: 3.7 kB ℹ️ View Unchanged
|
|
Just for testing something — will close eventually |
🎯 Changes
This PR adds debug logging and comprehensive test coverage for the
columnMapper.encodefunctionality in theloadSubsetmethod:Changes to
electric.ts:createLoadSubsetDedupeto indicate whethercolumnMapper.encodeis configuredDEBUG=ts/db:electric npm startin your browser console.Changes to
electric.test.ts:val,ref,func) for creating IR expressions in testsshould encode column names using columnMapper.encode in loadSubset WHERE clauseto verify that when acolumnMapper.encodefunction is provided, column names in the WHERE clause are properly encoded (e.g., camelCase to snake_case)should not encode column names when columnMapper is not providedto verify that column names remain unchanged when no columnMapper is configuredThese changes improve observability and ensure the column name encoding feature works correctly in the
loadSubsetmethod.✅ Checklist
pnpm test:pr.🚀 Release Impact