How it works
include file in project. Throw JSON at the parse function, this can be a string or a file. It will process the JSON into a SQLite database that will make working with the data a whole lot easier. This can deal with JSON that contains other objects and arrays.
Database layout
Below is the SQL that creates the required json_data table.
Code: Select all
CREATE TABLE "json_data" (
"id" INTEGER,
"key" TEXT,
"parent_key" INTEGER,
"type" TEXT,
"value" TEXT,
PRIMARY KEY("id")
);
Please note parent_key is used for encountered objects or arrays. Key is the name of the json key, type will tell you if its a string,integer, etc. Value, well that's the value. Right now aside from the parsing you will needed to run the required querys on the data to do with as you please. I may add some additional functions soon to make that simpler as well. I'm also open to ideas and such if you have them.