A simple SQL query engine for JSON data with a web interface. This application allows you to run SQL-like queries against flat JSON arrays of objects.
SELECT
(comma separated list of columns or *
)FROM
(required but not actually used)WHERE
(conditions with =
, !=
, <
, >
, AND
, OR
, parentheses)LIMIT
(integer)Example queries:
SELECT state FROM table WHERE pop > 10000000 AND state != 'California';
SELECT * FROM table WHERE pop > 20000000 OR (pop > 10000000 AND region = 'Midwest');
SELECT * FROM table WHERE pop_male > pop_female;
To build the project, run:
cabal build
Run the application with a JSON file as the argument:
cabal run query-lite-sql-exe -- sample.json
Then, open your browser and navigate to:
http://localhost:3000/
src/
- Source code for the Haskell applicationQueryLiteSQL/Parser/SQL.hs
- SQL parserQueryLiteSQL/Parser/Executor.hs
- Query execution engineQueryLiteSQL/Database/Schema.hs
- Database schema for query historyQueryLiteSQL/Web/Routes.hs
- Web routes for the APIQueryLiteSQL/Types/Env.hs
- Environment configurationapp/
- Main application entry pointfrontend/
- Web interfacesample.json
- Example JSON data file