smaltuismaltuismaltuismaltui

Small. Alternative. Query.

A SQL console for smaltdb that runs entirely in the browser

smaltui is an object explorer, a query editor and data grids for smaltdb, a fast alternative database for the browser. The database runs in a Web Worker on this page and keeps your data in your browser, in its private storage (OPFS) or in memory.

Try it here

This console runs a demo tea-and-coffee shop: tables, a view, a materialized view, a linked CSV and sales data imported from a Parquet file. It is loaded into an in-memory smaltdb in your browser. Pick an example or write your own SQL, then press Ctrl+Enter.

Starting smaltdb… Open in workbench ↗

What the workbench does

Object explorer

Tables, views, materialized views, external tables and connections, with columns and keys. Right-click an object to script SELECT, INSERT or DDL, count rows, refresh or drop it.

Query editor

Tabs with highlighting and completion of names and aliases. Run the statement at the cursor or a whole script. Bind variables, query plans, and syntax errors marked where they occur.

Data grids

Virtualized results that are fetched on demand. Browse tables with paging, sorting and a WHERE filter. Edit cells and add or delete rows in tables with a primary key.

Import & link

Load CSV, TSV, JSON, NDJSON or Parquet into a table. Or link a file or URL as an external table that is read in place.

Environments

A JSON manifest builds a database when the page opens: its schema, data, linked sources and saved queries. Share a link and others get the same workspace.

Your data stays in your browser

Databases live in your browser's private storage (OPFS) or in memory. The page fetches only the files and URLs you import or link.

Serve a live environment

smaltui is a folder of static files. Put an environment manifest next to it and link to workbench/?env=path/to/env.json. Every visitor gets the database built in their own browser. The demo above is one such file.

{
  "smaltui": 1,
  "name": "Demo shop",
  "database": { "name": "demo", "storage": "memory" },
  "steps": [
    { "sqlFile": "schema.sql" },
    { "import": "data/orders.csv", "table": "orders" },
    { "import": "data/regional_sales.parquet",
      "table": "regional_sales" },
    { "link": "data/exchange_rates.csv",
      "table": "exchange_rates" }
  ],
  "queries": [{ "title": "Revenue", "sql": "SELECT …" }]
}
  1. smaltdb runs in a Web Worker. It comes from the npm package and is served with the page, so queries never block the UI.
  2. Data stays local. Databases are kept in the browser's Origin Private File System or in memory. External tables read files and URLs only when they are queried.
  3. Any static host works. This site is served by GitHub Pages. With COOP/COEP headers (Netlify, Cloudflare), smaltdb also runs queries on parallel worker threads.