~115.25 MB CPU WASM 2 Chained Workers 0 Bytes Uploaded
About & Code

Standalone App & PWA

Launch Local SQL Analyst on its dedicated origin to install it as an offline desktop or mobile PWA with .csv, .tsv, .json, and .txt spreadsheet file handlers and isolated OPFS table storage.

Open sql.webai.show ↗

Honest cache note: browsers isolate Cache Storage and OPFS per origin, so sql.webai.show stores its own local ONNX weights (~115.25 MB). Staying on webai.show shares cached weights with the bge-small-en-v1.5 and t5-small-awesome-text-to-sql model pages.

OPFS ready

Stage 1 · BGE-Small Schema Linker (34.73 MB q8 · MIT)

Xenova/bge-small-en-v1.5 · 384-d CLS cosine

Stage 2 · T5-Small Text-to-SQL (80.52 MB q8 · Apache-2.0)

Xenova/t5-small-awesome-text-to-sql · schema-conditioned

Pure-ESM relational SQL engine active immediately. Load the 2 CPU WASM workers above for BGE schema linking & T5 SQL generation.

2 tables · 22 rows · 0 bytes uploaded
Loaded Tables–
Top Linked Column–
T5 SQL Decode–
Query Output–
Latencies & NaN–

Schema Inspector & SQL Editor

0 tables

Quick SQL Recipes

Instant local execution

Query History

Query Results & Interactive Chart

No results

Interactive SVG Chart

Run a query to inspect chart points.

Local Exports (OWASP Formula-Safe)

See Inside — Schema Conditioning & BGE Column Ranking

Click Ask in Plain English once either model is loaded to inspect the BGE cosine schema-linking scores, the exact tables:\nCREATE TABLE ...\nquery for:... prompt, and SentencePiece input tokens.

How Local SQL Analyst Works

Two compact CPU WebAssembly models chained strictly off the main thread — BGE-Small Schema Linker (34.73 MB q8 · MIT) and T5-Small Text-to-SQL (80.52 MB q8 · Apache-2.0) — totaling ~115.25 MB paired with a zero-dependency pure-ESM relational SQL engine so spreadsheets never leave your device.

Pure-ESM Relational Engine

executeSql() parses and evaluates multi-table JOINs, WHERE predicates (LIKE, IN, BETWEEN, IS NULL), GROUP BY, HAVING, aggregates, and ORDER BY inside a read-only sandbox that blocks mutating DDL/DML and suggests column fixes on typos.

2-Stage CPU WASM Chain

worker-embed.js embeds question + schema descriptors with BGE CLS pooling + retrieval query prefix; worker-sql.js streams SQL tokens via TextStreamer with strict FIFO queues and epoch-safe dispose() guards.

OPFS, Charts & Safe Exports

Uploaded .csv / .tsv / .json tables persist locally in OPFS, render into sortable tables and accessible SVG charts, and export cleanly with OWASP CSV formula neutralization.

Show the code — parseTableUpload() RFC 4180 CSV / TSV / JSON ingestion & type inference
Show the code — buildColumnDocuments() & rankSchemaLinks() BGE cosine schema linking
Show the code — executeSql() pure-ESM relational JOIN, GROUP BY, HAVING & ORDER BY engine
Show the code — recommendChartSpec() Bar / Line / Scatter chart auto-recommendation
Show the code — escapeCsvCell() OWASP formula-injection neutralization
Show the code — StageWorkerClient FIFO queue, streaming & disposeEpoch lifecycle
Show the code — OpfsTableStore local browser table persistence
Show the code — registerSqlAnalystWebMcpTools() describe_schema, run_sql & ask_sql