orm icon indicating copy to clipboard operation
orm copied to clipboard

Support for NOT LIKE

Open xpavp03 opened this issue 7 months ago • 3 comments

Hi, I'm wondering why NOT LIKE was not implemented along with LIKE.

It appears to me that CompareNotLikeFunction could exist, just like there's CompareNotEqualsFunction. And that ConditionParser could recognize !~.

I'm sure though, you must have had a reason for not implementing it, so I'm just curious what it was.

Thank you.

xpavp03 avatar May 28 '25 12:05 xpavp03

I'm sure though, you must have had a reason for not implementing it, so I'm just curious what it was.

No reason, pure omission.

Practically, it is possible to easily work around by introducing your own function Not() that will negate.

hrach avatar May 28 '25 13:05 hrach

Practically, it is possible to easily work around by introducing your own function Not() that will negate.

Interesting approach!

Or maybe ICollection::NOT and NotOperatorFunction would also work.

Anyway, I would prefer using the !~ syntax, and have ConditionParser recognize it. I guess even in that case a NotFunction could be used, and applied in place of CompareNotEqualsFunction.

Would you be interested in a pull request that implements the NotFunction with changes to ConditionParser?

xpavp03 avatar May 28 '25 14:05 xpavp03

I welcome opening PR with LikeExpression::MODE_NOT_CONTAINS. Adding another mode for RAW does not make much sense. I welcome opening PR with NotFunction.

hrach avatar May 30 '25 19:05 hrach