SQLite ionic native plugin with JSON1 extension

Hi everyone!
I am using the ionic native SQLite plugin: @ionic-native/sqlite - npm to store some information in my hybrid mobile application.
My doubt, it is the following one: is it possible to include the JSON1 extension?
In my case, I need to do some queries using the json_extract() function because I am storing an object as JSON in a specific column of my database.
So now, I can’t do this query, because the ionic plugin doesn’t recognise the json_extract function:

In this example I need to obtain the sectionId value, that is in the column gf.field (this is a JSON object that has the sectionId property).

SELECT s.id, gf.field, json_extract(gf.field,'$.sectionId') AS fieldSectionId  FROM sections s
WHERE s.orderId = '123' and gf.itemId='item1' and fieldSectionId = s.sectionId`;

btw, I am using the latest version of this plugin: “@ionic-native/sqlite”: “^5.34.0”

Thanks in advance!

Did you get an answer to this question?

Nop, as a workaround I am storing the info that I need (that it is an object property) in a different column. In my case this approach is valid as well, but of course, it would be useful integrate the JSON1 extension inside the sqlite plugin, but I don’t have answer so far :frowning_with_open_mouth:.

1 Like