Add debug logging and tests for columnMapper.encode in loadSubset#1176
Draft
KyleAMathews wants to merge 3 commits intomainfrom
Draft
Add debug logging and tests for columnMapper.encode in loadSubset#1176KyleAMathews wants to merge 3 commits intomainfrom
KyleAMathews wants to merge 3 commits intomainfrom
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: |
Contributor
|
Size Change: 0 B Total Size: 90.9 kB ℹ️ View Unchanged
|
Contributor
|
Size Change: 0 B Total Size: 3.7 kB ℹ️ View Unchanged
|
Collaborator
Author
|
Just for testing something — will close eventually |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🎯 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