Developer builds offline SQL engine inside a single HTML file without WebAssembly
A developer has added a functional SQL console to dataloupe, a tool that converts CSV files into self-contained, single HTML files viewable without an internet connection. Rather than embedding a heavyweight WebAssembly database like SQLite or DuckDB, the implementation uses a lightweight hand-written tokenizer and recursive-descent parser that converts SQL text into a query-spec object. The parser supports a practical subset of SQL including SELECT, WHERE, GROUP BY, ORDER BY, and common aggregates, adding only kilobytes to the output file. No eval or Function() calls are used anywhere, allowing the feature to comply with strict Content Security Policies while keeping all data processing entirely client-side. The approach demonstrates that apps with an existing structured query layer can offer SQL input to users by writing a small parser, without adopting a full database engine or making any network requests.
This is an AI-generated summary. ShortSingh links to the original source for the complete article.
Discussion (0)
Log in to join the discussion and vote.
Log in