user9500574
user9500574

Reputation: 152

Can I use Laravel JSON Where Clauses with MariaDB 10.2.16 LongText column?

I tried to add a json column to my database by using phpMyAdmin

but Unfortunately, phpMyAdmin converts the json column to Longtext type

So, I'm asking about the ability to use the JSON Where Clauses with this type

https://laravel.com/docs/5.7/queries#json-where-clauses

Upvotes: 1

Views: 1033

Answers (1)

Darryl E. Clarke
Darryl E. Clarke

Reputation: 7637

You cannot use those queries on non-JSON data types in MariaDB. And as of 10.2, it doesn't officially support it.

You can use the JSON helper functions to query against data (ie: where JSON_CONTAINS(...) and others.

You can also create columns that are extracted values from the JSON data using Virtual Columns

Here's a good post with much more detail.

Upvotes: 3

Related Questions