-
Notifications
You must be signed in to change notification settings - Fork 151
Fix QueryCompilationError with undefined expression type #1082
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
…perator usage
When users accidentally use JavaScript's comparison operators (===, !==, <, >, etc.)
in where() callbacks instead of query builder functions (eq, gt, etc.), the query
builder now throws a helpful InvalidWhereExpressionError with clear guidance.
Previously, this mistake would result in a confusing "Unknown expression type: undefined"
error at query compilation time. Now users get immediate feedback with an example of
the correct syntax.
Example of the mistake this catches:
❌ .where(({ user }) => user.id === 'abc')
✅ .where(({ user }) => eq(user.id, 'abc'))
🦋 Changeset detectedLatest commit: e5cb780 The changes in this PR will be included in the next version bump. This PR includes changesets to release 12 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
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: +280 B (+0.31%) Total Size: 89.8 kB
ℹ️ View Unchanged
|
|
Size Change: 0 B Total Size: 3.35 kB ℹ️ View Unchanged
|
willmruzek
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't know if my review counts, but LGTM! Thank you!
…perator usage
When users accidentally use JavaScript's comparison operators (===, !==, <, >, etc.) in where() callbacks instead of query builder functions (eq, gt, etc.), the query builder now throws a helpful InvalidWhereExpressionError with clear guidance.
Previously, this mistake would result in a confusing "Unknown expression type: undefined" error at query compilation time. Now users get immediate feedback with an example of the correct syntax.
Example of the mistake this catches:
❌ .where(({ user }) => user.id === 'abc')
✅ .where(({ user }) => eq(user.id, 'abc'))
🎯 Changes
✅ Checklist
pnpm test:pr.🚀 Release Impact