Off the main thread
The engine runs in Web Workers, so queries never block the page.
A fast alternative database for the browser, written in TypeScript.
import { open } from 'smaltdb';
const db = await open('app'); // engine runs in a worker, data lives in OPFS
await db.exec('CREATE TABLE IF NOT EXISTS todo(id INTEGER PRIMARY KEY, title TEXT NOT NULL, done INT DEFAULT 0)');
await db.exec('INSERT INTO todo(title) VALUES (?)', ['write docs']);
const rows = await db.query('SELECT id, title FROM todo WHERE done = 0');