This site is home to the documentation for the SQLite project's WebAssembly- and JavaScript-related APIs, which enable the use of sqlite3 in modern WASM-capable browsers.

Cookie/storage disclaimer: this site requires a modern, JavaScript-capable browser for full functionality. This site uses client-side storage for persisting certain browsing preferences (like the bright/dark mode toggle) but its server does not process, nor transfer to any other entity, any user-level information beyond certain SCM-side display-related preferences and the credentials of logged-in developers.

Site Overview

- 📰 Project news

- 💬 FAQ: Frequently Asked Questions

- 🚧 TODOs and (un)planned features

- ☎ Technical support is provided, and feedback gladly accepted, via the sqlite forum. Those with commercial SQLite support contracts may use their usual support channels.

Making use of this project:

- 👣 The three-step HOWTO demonstrates how to include and run the sqlite3 WASM module and its associated JavaScript APIs.

- 💾 Downloads are available via the main project downloads page. - 📸 Prerelease snapshots are updated from time to time

- 📦 npm module

- 🛠 Building sqlite3 WASM and its associated JS code. - Emscripten build specifics

- 📇 The API index describes the various API variants and how to load and access them. - 🧑🍳 Cookbook of recipes for client-level code

- 💾 Persistent storage options

- 🤓 Using C-structs in the JS API

- 🧱 Creating virtual tables and table-valued functions in JS

- 💣 API changes which might affect clients

- 🔭 The module symbols app generates lists of sqlite3 API symbols from the JavaScript/WASM module.

About this documentation:

In the Wild

Third-party projects known to be using this project include (in order of their addition to this list)...

- SQLime provides a database browser interface.

- Evolu Evolu is a local-first platform designed for privacy, ease of use, and no vendor lock-in.

- SQLiteNext provides a demo of integrating this project with next.js.

- sqlite-wasm-esm demonstrates how to use this project with the Vite toolchain.

- sqlite-wasm-http provides an SQLite VFS with read-only access to databases which are served directly over HTTP.

Related Works

(In the order in which we became aware of them...)

- Alon Zakai's sql.js is the first known direct usage of sqlite3 in a web browser, dating back to 2012, not counting WebSQL (which was a native-level feature and has long since been removed from browsers).

- Roy Hashimoto's wa-sqlite is home to the first known implementation of OPFS storage of sqlite3 databases. It is also the home of much innovation regarding JS-side SQLite VFSes.

- James Long's absurd-js demonstrates storing sqlite3 databases inside IndexedDB databases.

- postgres-wasm runs a Postgres database server in a browser.

- Jaccwabyt is a small JS library for manipulating WASM-hosted C structs via JS code, created specifically to support the OPFS sqlite3_vfs implementation in this project. This project embeds a copy but does not expose it to client applications.

- CoWasm is "Collaborative WebAssembly for Servers and Browsers". Their demo app includes a WASM build of the sqlite3 shell application.

- absurder-js is Nicholas G. Piesco's re-imagining of absurd-js. See also: his announcement of it on the SQLite forum.

- sqlite-wasm-rs provides

Rust SQLite bindings for wasm32-unknown-unknownbuilds.

Third-party Documentation and Articles

The following links reference articles and documentation published about SQLite WASM by third parties:

- Porting WebSQL to OPFS, by the Google Chrome dev team

- The VMWare OCTO team writes about building SQLite3 for WASI