mirror of
https://github.com/doctrine/orm.git
synced 2026-03-23 22:42:18 +01:00
User Defined Function and Comparison Operator #5410
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 @dautushenka on GitHub (Feb 6, 2017).
I work with PostgreSQL. I implemented custom function for working with array type
DQL:
CONTAINS(field, '{1,2}')which should converted into SQL:
field @> '{1,2}'When I was trying to apply with function I got error:
After digging into the code I found out that parser requires comparison operator also.
I use following workaround:
CONTAINS(field,?1) = TRUEI think we need to implement ability to create custom operators.
@Ocramius commented on GitHub (Feb 6, 2017):
What's missing is probably a boolean function - we support string/date/numeric atm, but not boolean.
@dautushenka commented on GitHub (Feb 6, 2017):
@Ocramius It also will fix the issue.
@zspine commented on GitHub (Jul 7, 2017):
Seems like most of the PostgreSQL functions requires it. I had the same issue with jsonb functions.
@dautushenka Thanks a lot for sharing the workaround!!! I have been trying to debug this for more than 4 hours....
@esbobkov commented on GitHub (Nov 3, 2017):
I have problem with Comparison Operator. I want to use POSIX Regular Expressions in Postgres. Operator is
~But in not supported