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

Can I cast a field from the client side and have it reflected in the db query? #172

Closed
philipimperato opened this issue Feb 23, 2022 · 0 comments

Comments

@philipimperato
Copy link

philipimperato commented Feb 23, 2022

I'm trying to search on a field using $ilike but the field is an integer.

Using Postgres

The query is simple amount::text $ilike '%100%'. I would like to be able to indicate this from the clientside, but I can't seem to figure it out as the db will always wrap it with double quotes and throw an error.

This is what the query looks like:
where (("amount::text" ilike '%100%'))

This is the postgres / objection error:
operator does not exist: integer ~~* unknown

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

No branches or pull requests

1 participant