JSQLitebeta

READ-ONLY SQLITE · PURE TYPESCRIPT

Your database.
Your browser.
No query server.

Open an immutable SQLite file over HTTP and query it locally. JSQLite translates SQLite's C internals into browser-safe JavaScript — without native code or WebAssembly.

Run a real query ↓How it works
Named ESM exportsExact 64-bit integersPrepared statements

LIVE PLAYGROUND

Meet your next query.

A real SQLite music database.
Actual results, computed on your device.

The browser fetches a bundled 1 MB Chinook database, then executes SQL in a dedicated worker. No SQL is sent to a backend. Demo limit: 1,000 rows and 60 seconds per run.

Results

Loading playground…

INTEGER values are displayed exactly; NULL and BLOB values retain their types. Hover over a cell to see its storage class.

Dataset: Chinook · MIT license. Engine pinned to v0.0.0-beta.3. This demo is not a complete compatibility test. Known beta limitations apply.

SMALL API. REAL SQLITE FILES.

From URL to rows.

1. Serve a clean snapshot

Publish an immutable SQLite main database file. Apply pending WAL/journal changes before publishing. For another origin, configure CORS to allow browser access.

2. Open, prepare, step

Execution is asynchronous; local column access isn't. INTEGER values use bigint, blobs use Uint8Array, and SQL NULL is null.

3. Release your handles

Finalize each statement and close its connection. Use cancellation and resource limits for untrusted SQL or files.

import { open } from './assets/engine/index.js';

const db = await open(new URL(
  './assets/chinook.sqlite', import.meta.url
));
try {
  const { statement } = db.prepare(
    'SELECT Name FROM Artist LIMIT 5'
  );
  if (statement) {
    try {
      while (await statement.step() === 'row') {
        console.log(statement.column(0));
      }
    } finally { statement.finalize(); }
  }
} finally { db.close(); }

Serve the complete ESM module tree, not only index.js. No npm registry release is available yet. Download the beta.3 package; see the release scope and build instructions, API reference, or the versioned installed-package demo.

BETA, WITH HONEST BOUNDARIES

A working core. Not all of SQLite.

What it does

Read-only queries on immutable database files, with implemented SELECT, joins, aggregates, subqueries/views, CTEs, windows, functions and index paths at documented admission boundaries. UTF-8 and both UTF-16 encodings are supported. Beta.3 adds STAT4-informed scalar range estimates for selected skip-scan paths, plus sample-ownership and numeric-production corrections.

What it doesn't promise

Not every query composition or optimizer path is implemented. Unsupported cases should fail explicitly; report incorrect results. Chromium has tested coverage; other browsers are not yet certified. Large temporary working sets are memory-limited; OPFS spill is not advertised.

What stays out of scope

Writes, transactions, WAL recovery, native/WASM query backends and external extensions. Publishers supply clean immutable files; the browser does the query work.

Remaining beta boundaries: arbitrary generated/module, nested, joined window/compound and virtual-table planner combinations are not universally supported. Cooperative cancellation and memory limits are not hard-real-time or native allocator guarantees. Broader index-supported SELECT coverage is beta.4 work, not claimed here. Earlier releases remain unchanged.

Read the beta.3 release scope and evidence and exact-version admission contracts before choosing JSQLite for an application. The broad compatibility goal is ongoing, not a percentage already achieved.