- Be sure your popup blocker is turned off!
- jQuery is not required. This example uses it simply to pull in an external json file.
- The pretty dump is compliments of Net Grow and as well is not required.
Usage and Syntax Notes
- Only Select statements are supported
- The requested fields may be a "*" or a list of fields. "*" is likely faster in most cases.
- When typing lists "select field1,field2,field3" or "limit 5,10 do not use spaces.
- When using the "where" clause enclose all conditions with one set of parenthesis "where (category=='The Category' || category=='Other Category')".
- The from clause should establish the scope you would like returned. It should start with "json" and use the dot notation: "json.channel.items" and should point to an array within the object.
- The order by option can accept a list but will only order by the first field at this time(asc,desc,ascnum,descnum).
select title,url from json.channel.items where (category=='bla' || category=='bla bla') order by title desc limit 5,10
jsonsql.query("select * from json.channel.items order by title desc",json);
This library definitely is not the fastest parsing solution compared to xpath for xml, however simplicity at times may out weigh the need for speed.
jsonsql.js Version 0.1
Last updated on 12/30/2007
Apache License, Version 2