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

JSON function in SQLite #116

Open
marcus-at-localhost opened this issue Apr 29, 2022 · 0 comments
Open

JSON function in SQLite #116

marcus-at-localhost opened this issue Apr 29, 2022 · 0 comments

Comments

@marcus-at-localhost
Copy link
Contributor

I'm using f3-schema-builder and f3-cortex to create temporary SQLite database for API data.
Right now, I'm just storing the JSON string and then pull it out and access JSON fields with PHP.
But I need to query and aggregate the JSON more precisely, and SQLite seems to support that now:
https://www.delphitools.info/2021/06/17/sqlite-as-a-no-sql-database/
https://www.sqlite.org/json1.html

How could I use this in F3 and keep some benefits of f3-cortex/schema-builder or do I have to go raw SQL for anything JSON related?

If I set up Cortex this way: https://github.com/ikkez/f3-cortex#set-up how can I add an index like this:
create index test_extract_vx_idx on test(json_extract(data, '$.vx')) ? Just raw SQL?

Is it possible to extend Cortex to my special needs? Or do I have to overwrite too many methods?

Thanks for any hints.

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

No branches or pull requests

1 participant