A SQL-like engine for querying JSON data directly in the browser.
jsql allows you to run SQL queries against JSON datasets directly in the browser. It parses the SQL and evaluates it against the provided JSON object.
- Standard SQL Syntax:
SELECT,FROM,WHERE,ORDER BY,LIMIT. - Table Aliases: Use aliases for tables (e.g.,
FROM users u). - Deep JSON Access: Query nested properties using dot notation (e.g.,
address.streetoru.address.streetwith table alias). - Filtering: Support for
AND,OR,NOT, and comparison operators (=,>,<,>=,<=,!=,LIKE). - Sorting: Order results by any field in
ASCorDESCorder, including multiple columns. - Grouping and Aggregation:
GROUP BYwith aggregate functions likeCOUNT,SUM,AVG,MIN,MAX, includingDISTINCTsupport.HAVINGclause for filtering grouped results.- Columns not in
SELECTbut used inGROUP BYare allowed; an arbitrary value from the group is returned (typically the first record). GROUP BYcolumns do not automatically appear in results—only columns specified inSELECTare returned.
- JOIN Support: INNER JOIN with ON clause (parsing implemented, evaluation in progress).
- Aliases: Rename columns and aggregates using
AS. - Instant Feedback: Runs in real-time in the browser.