Skip to content

Commit

Permalink
Improve wording on the whereJsonContains method and SQLite support (#…
Browse files Browse the repository at this point in the history
…9198)

* Update queries.md

I find the wording "This feature [whereJsonContains] is not supported by SQLite database versions less than 3.39.0" misleading.
This wording suggests that the "whereJsonContains" method can be used by merely using a compatible version of SQLite, which is not true; while SQLite does support JSON functions since version 3.39.0 (as already stated in the previous paragraph), the SQLite Grammar does not support the "whereJsonContains" clause regardless of the version of SQLite.

* Update queries.md

---------

Co-authored-by: Taylor Otwell <taylor@laravel.com>
  • Loading branch information
danieleambrosino and taylorotwell committed Dec 15, 2023
1 parent f65845f commit 0991136
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion queries.md
Original file line number Diff line number Diff line change
Expand Up @@ -491,7 +491,7 @@ Laravel also supports querying JSON column types on databases that provide suppo
->where('preferences->dining->meal', 'salad')
->get();

You may use `whereJsonContains` to query JSON arrays. This feature is not supported by SQLite database versions less than 3.39.0:
You may use `whereJsonContains` to query JSON arrays. This method is not supported by SQLite:

$users = DB::table('users')
->whereJsonContains('options->languages', 'en')
Expand Down

0 comments on commit 0991136

Please sign in to comment.