mirror of
https://github.com/doctrine/orm.git
synced 2026-03-23 22:42:18 +01:00
Boolean expressions (like comparison expressions, without the comparison) #5205
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @teohhanhui on GitHub (Aug 2, 2016).
From jsor/doctrine-postgis#14
The following DQL:
gives
The workaround is to change it to:
It'd be great if the DQL parser would support boolean expressions.
@DaDeather commented on GitHub (Apr 29, 2019):
Another Information to note is that in this case a spatial index is being omitted when comparing the return value of these spatial functions.
@ksaveras commented on GitHub (Apr 8, 2020):
👍
@wouterj commented on GitHub (Jan 7, 2021):
I'm willing to help work on this, as this is quite limiting for us (as @DaDeather mentioned, DQL at the moment only allows writing queries that completely omit any spatial index).
However, this seems quite some task for someone that never contributed to Doctrine, so I would like some guidance if possible :). As a start: does this have a possibility of being accepted if implemented as suggested in the description? and where do I add tests for this? (I don't see much tests in
ParserTestand I'm unsure where to put them)@cte-silico commented on GitHub (Jul 19, 2022):
Hello,
I have the same issue with SQL server "contains" fulltext search function that does not accept comparison.
Here is the DQL:
SELECT count(s.id) FROM AppBundle\Entity\Scan s INNER JOIN s.documents documents WITH documents.num=1 WHERE contains(documents.name,'ppc') AND charindex(:value_62d6c8746d9f7,documents.name,0) >= 0I cannot change contains(...) to contains(...) = true since SQL server does not allow it (raise error on =)
I'm stuck with this and cannot do a raw query
It is legitimate to allow Expr/Func as conditions since it is native sql query conditions