SQLR-42 — WASM in-browser SQL playground (/playground)#149
Merged
Conversation
A zero-install browser SQL playground running the full SQLRite engine in WebAssembly. CodeMirror 6 editor, sample datasets (Pokémon, Northwind multi-table JOINs, Movies + HNSW cosine vector search), results grid with column types / NULL highlighting / CSV export, share-via-URL-hash, and OPFS session persistence via SQL-script replay. Embedded at /playground on sqlritedb.com with a homepage card + hero CTA and a nav link. - Rebuilt sdk/wasm and vendored the pinned pkg into web/public/playground/pkg (~752 KB gzipped, under the 4 MB budget); loaded via an external runtime import() kept out of the bundler. - Persistence is script-replay, not binary .sqlrite — the WASM SDK is in-memory with no serialization. Binary round-trip tracked in SQLR-71. - Examples page (shipped card + JSON-LD), sitemap, and READMEs updated; OG/Twitter images added. sdk/wasm/Cargo.lock refreshed by the build. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What this is
A zero-install, browser-only SQL playground that runs the full SQLRite engine entirely in WebAssembly — the highest-marketing-leverage example from the SQLR-38 umbrella. Reachable at
/playgroundon sqlritedb.com.Features
#sql=hash), Download / Upload.sqlArchitecture
web/src/app/playground/; ships as a statically-prerendered Next route (109 kB First Load JS, CodeMirror lazy-loaded viadynamic(ssr:false)).sqlrite-enginecrate, built with wasm-pack and vendored as a pinned copy intoweb/public/playground/pkg/(~752 KB gzipped, under the 4 MB budget). Loaded with a runtimeimport()kept external from the bundler (wasm-pack'simport.meta.urlglue doesn't survive webpack).examples/wasm-playground/README.md.Scope decision (recorded on SQLR-42)
The WASM
Databaseis in-memory only with no serialization, so a binary.sqlritebyte image can't be produced in the browser today. Per discussion, v1 persists the SQL script (replayed on reload) and downloads/uploads.sql. Binary.sqlriteround-trip (needs an in-memory pager backend +Database.export()/import()) is filed as SQLR-71.askis omitted (needs a server key).Testing
wasm-pack build·tsc·next lint·next build(51 pages)next start): boot+OPFS badge, all 3 datasets incl. HNSW KNN, error pane, CSV +.sqldownloads,#sql=share round-trip, persistence-across-reload, reset, Cmd+Enter.ORDER BY(engine supports single-key only).Notes
sdk/wasm/Cargo.lockrefreshed by the build (stale0.1.23→0.10.2)./favicon.ico404 is unrelated to this PR.🤖 Generated with Claude Code