Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[5.6] Support JSON SELECT queries on SQLite #25328

Merged
merged 1 commit into from
Aug 26, 2018
Merged

[5.6] Support JSON SELECT queries on SQLite #25328

merged 1 commit into from
Aug 26, 2018

Conversation

staudenmeir
Copy link
Contributor

@staudenmeir staudenmeir commented Aug 25, 2018

Adds JSON SELECT queries to SQLite:

DB::table('users')->select('items->price')->where('items->price', 1)->orderBy('items->price');

In order for this to work, the JSON1 extension has to be enabled. That's the case in the latest versions of Homestead.

Users without the extension will get an error: General error: 1 no such function: json_extract
Of course, that's not really helpful. But to detect this beforehand, we would have to run an extra pragma compile_options query and look for ENABLE_JSON1.

There is apparently no way to support whereJsonContains().

There is no integration test because the JSON1 extension isn't available on Travis CI (I tried).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants