$ ./sql-analytics
// DuckDB compiled to WebAssembly. Drop in CSV, JSON, Parquet, Excel or raw log files and query them with SQL. Your files never leave your browser, and after the first visit it works offline.
or drag & drop files here
query.sqlctrl/⌘+enter runs · tab completes table and column names
export:
How it works
- Each file becomes a table named after it:
access.log→access. If two files would get the same name the second gets its extension appended (data_json); SQL keywords get_data(order.csv→order_data). Click a table chip to query it. - CSV/TSV, JSON/NDJSON, Parquet and Excel (
.xlsx, first sheet; useread_xlsx('file.xlsx', sheet='Sheet2')for others) are detected automatically..log/.txtload as onelinecolumn per line. Parse them withregexp_extract(), as the examples do for nginx logs. - paste data turns CSV, TSV or JSON from your clipboard into a table.
- Numbers are exact: 64-bit IDs,
HUGEINTandDECIMALare shown digit for digit, never rounded through floating point. - The grid shows the first 1,000 rows. Exports (CSV, Parquet, JSON) always contain the full result. Clicking a header sorts the shown rows; use
ORDER BYto sort everything. - Charts: a result whose first column is a label or time, with numeric columns after it, gets an automatic bar or line chart. The builder under it lets you pick the type (bar, horizontal, stacked, line, area, scatter, pie), the x column and up to six series, sort and keep the top N, add a title, and download it as SVG or PNG. aggregate groups the full result by x in DuckDB (sum, avg, count, min, max; time columns can be bucketed per minute…year), so you can chart a raw table without writing the GROUP BY.
- Files are read straight from disk on every query. For repeated queries on a big file, materialize it first:
CREATE TABLE t AS SELECT * FROM file_table. - Everything runs locally (DuckDB-Wasm). Nothing is uploaded; closing the tab forgets your data. Your draft query and history stay in this browser.
- Handy:
SUMMARIZE tablename,regexp_extract,strptime,date_trunc,quantile_cont,histogram.