minisql

small tool to query json files with ltl-flavored sql queries
Log | Files | Refs | README

readme.md (1536B)


      1 # minisql
      2 > simple sql querying over json files
      3 
      4 `minisql` is a small program that lets you query flat JSON files with relatively
      5 simple SELECT queries. It also supports a number of extended queries based off
      6 of linear temporal logic for interacting with temporal data: see
      7 [LTL.md](https://github.com/quantumish/minisql/blob/master/ltl.md) for a writeup
      8 on the inclusion of these features!
      9 
     10 ## install
     11 Run `install.sh` which will automatically install SML locally and compile `minisql`.
     12 
     13 ## usage
     14 Run `./minisql` to run queries. No need for a command line argument: simply use the
     15 name of the JSON file you want to query as the name of the table in your query and
     16 `minisql` will parse it on the fly.
     17 
     18 You can generate some sample data to play with by running `randgen.py`. See `ltl.md`
     19 for more info.
     20 
     21 Example query (over the file `cities.json` in the current directory):
     22 ```
     23 $ ./minisql
     24 SELECT * FROM cities WHERE (pop > 1000000 AND pop_male > 2) AND state != 'California' LIMIT 5;
     25 ```
     26 which results in:
     27 ```
     28 state          | region    | name                  | pop       | pop_male | pop_female
     29 South Dakota   | Midwest   | Titanium Difficulties | 889974703 | 458536   | 250643    
     30 Wisconsin      | West      | Idaho Montgomery      | 428577562 | 764134   | 683030    
     31 Georgia        | Southwest | Glasgow Temper        | 35972038  | 44695    | 652128    
     32 South Carolina | South     | Handles Mineral       | 260061223 | 515245   | 944841    
     33 Delaware       | North     | Click Epa             | 658863391 | 73868    | 451517    
     34 ```