Skip to content
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

eb assumes unknown operators to be arithmetic operators #891

Open
koskimas opened this issue Feb 28, 2024 · 1 comment
Open

eb assumes unknown operators to be arithmetic operators #891

koskimas opened this issue Feb 28, 2024 · 1 comment
Labels
bug Something isn't working typescript Related to Typescript

Comments

@koskimas
Copy link
Member

Consider this snippet

where(eb => eb('first_name', sql`%>>`, 'Jennifer'))

This will cause a type error since the operator is assumed to be arithmetic and the output type of the expression is string.

One way to solve this could be

where(eb => eb('first_name', sql<boolean>`%>>`, 'Jennifer'))

or we bring back the cmpr function 😬

@koskimas
Copy link
Member Author

Or we could make boolean the default expression type. Unknown operators would create a boolean expression. That's probably a better assumption (?)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working typescript Related to Typescript
Projects
None yet
Development

No branches or pull requests

2 participants