Add table column filter support for JSON type#1747
Conversation
| Types::DATETIME_MUTABLE => FilterModel\TypeDatetime::class, | ||
| Types::DATETIME_IMMUTABLE => FilterModel\TypeDatetime::class, | ||
|
|
||
| Types::JSON => FilterModel\TypeString::class, |
There was a problem hiding this comment.
These types are casted to non-string in PHP, the php values are never used in these filters?
There was a problem hiding this comment.
Yes it looks like that. For example, type=json field shows as text in grid column and looks like filter works on top of it.
Probably @ibelar could check this in more details too.
Of course, filtering as string will not be the best option, but at least it will not throw exception then and at least partly work as filter.
There was a problem hiding this comment.
I also wonder if such filtering is even cross-DB compatible when the DB column type is native like JSON.
If it is, then maybe we can add FilterModel\TypeString::class as a fallback for any unspecified type
There was a problem hiding this comment.
If not compatible with all DB engines, then maybe we can somehow not add filter on these columns at all (automatically)?
What I don't like there is that ugly exception we get if json column is added in Grid with filters.
e432443 to
8734db9
Compare
mvorisek
left a comment
There was a problem hiding this comment.
LGTM, waiting for a green CI
|
Thank you! |

fix #1744
fix #1746