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

fix(core): fix querying embeddables over cast fields #1639

Conversation

francisco-sanchez-molina
Copy link
Contributor

When within an embedded entity a numeric query is performed on a numeric field, the query is malformed:

SyntaxErrorException: select "e0".* from "user" as "e0" where "e0".("address4"->>'number')::float8 > 2 limit 1 - syntax error at or near "("

in this change the query builder prefix function detects if the field name has parenthesis, to add the alias inside

@francisco-sanchez-molina francisco-sanchez-molina changed the title fix(embedded): fix query over casted fields fix(embedded): fix query over cast fields Apr 2, 2021
@B4nan B4nan changed the title fix(embedded): fix query over cast fields fix(core): fix querying embeddables over cast fields Apr 3, 2021
@B4nan B4nan merged commit cb5b25c into mikro-orm:master Apr 3, 2021
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

Successfully merging this pull request may close these issues.

None yet

2 participants