Lack of interest JSON Contains/Extract in Finder. Use JSON instead of BLOB.

This suggestion has been closed automatically because it did not receive enough votes over an extended period of time. If you wish to see this, please search for an open suggestion and, if you don't find any, post a new one.

021

Well-known member
.ability to use $finder->where('metadata->something', '=', 'wow') instead of
PHP:
$expression = $finder->expression(
    sprintf(
        'json_unquote(json_extract(%s, \'$."%s"\')) = %s',
        $finder->columnSqlName('metadata'),
        'something', $finder->quote('wow')
    )
);

$finder->where($expression);

I also suggest using JSON or TEXT type in tables instead of BLOB.
 
Upvote 0
This suggestion has been closed. Votes are no longer accepted.
When they bump the minimum MySQL requirements, they're gonna switch to json column type. They've already stated that's the only thing keeping them from it.
 
Fwiw while json queries in MySQL are nice to have, peformance wise it'll almost always be better to abstract the column out if it's essential for a query. Especially as types like blob and text are offloaded from the database into their own files.
 
Fwiw while json queries in MySQL are nice to have, peformance wise it'll almost always be better to abstract the column out if it's essential for a query. Especially as types like blob and text are offloaded from the database into their own files.
.JSON selection example:
I am making an addition to pay via bitcoin using your server. In the provider_metadata field I enter data such as address and amount. This data is needed for sampling, but to do separate fields for them is a little illogical, because they are used only for one provider.
 
.JSON selection example:
I am making an addition to pay via bitcoin using your server. In the provider_metadata field I enter data such as address and amount. This data is needed for sampling, but to do separate fields for them is a little illogical, because they are used only for one provider.
You could still offload them into their separate table and join them onto the main one in that case.
 
Back
Top Bottom