-
-
Notifications
You must be signed in to change notification settings - Fork 21
Allowing string for comparison operator >,<,>=,<= #41
Comments
I think it is a db dependent problem, and possible implementation of it requires configuring DataFilter before using it, for example, by reading the app configuration database connection (can be few, which to choose?), then inject the properer DataFilterDriver (or something like that) particular for each database containing a set of allowed operators. Better doing it on db side by a function. Nevertheless I can be wrong :) |
Indeed, I was assuming it might be a db dependent feature. But to my knowledge, most modern db and programming languages allows string comparison, >,<,<= and >=. |
It is like that because mostly these operands do not make sense with strings if we're talking about data filtering. Property is public so if you need it you can always configure it. |
It makes perfect sense. If I want to find records starting from |
OK. Let's fix it then. |
This is now part of https://github.com/yiisoft/data package with this feature implemented. |
The package is currently not used. Need to implement bindins to it. |
DataFilter doesn't allow string for comparison operator >,<,>=,<= by default.
However mysql, mssql and php all allows string comparisons.
ex : 'ball' < 'water' is true
Shouldn't DataFilter allow it too?
What steps will reproduce the problem?
What is the expected result?
What do you get instead?
[{"field":"filter","message":"\"someString\" does not support operator \"lt\"."}]
Additional info
The text was updated successfully, but these errors were encountered: