gitwtfhub

wtf is sqlite-wasi?

nalgeon/sqlite-wasi — explained in plain English

Analysis updated 2026-08-10 · repo last pushed 2024-01-03

9CAudience · developerComplexity · 2/5DormantLicenseSetup · easy

TL;DR

A single-file WebAssembly build of SQLite that runs entirely in the browser or any JavaScript environment, letting you execute real SQL queries with no installation or backend server required.

Mindmap

mindmap
  root((repo))
    What it does
      Runs SQLite in browser
      Single WASM file
      In-memory only
    How it works
      Compiled with WASI
      SQLite version 3.44
      JS callbacks for output
    Use cases
      Interactive SQL tutorials
      Local data web apps
      No-backend database queries
    Limitations
      No file I/O
      Shell commands disabled
    License
      MIT licensed
      SQLite public domain

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

Why would anyone build with this?

REASON 1

Build an online SQL tutorial that lets users practice queries entirely in the browser.

REASON 2

Create a data-focused web app that runs complex SQL queries on local data without a backend.

REASON 3

Prototype database-driven features in a static website with zero server setup.

What's in the stack?

CWebAssemblyWASIJavaScriptSQLite

How it stacks up

nalgeon/sqlite-wasibodmer/png_test_onlydanterolle/tund
Stars999
LanguageCCC
Last pushed2024-01-032024-08-19
MaintenanceDormantStale
Setup difficultyeasyhardmoderate
Complexity2/54/53/5
Audiencedeveloperdeveloperdeveloper

Figures from each repo's GitHub metadata at analysis time.

How do you spin it up?

Difficulty · easy Time to first run · 5min

No file I/O means all data lives in memory for the session only, cannot persist to disk.

Use freely for any purpose, including commercial use, as long as you keep the copyright notice.

Wtf does this do

This repo lets you run SQLite, the popular database engine, directly inside a web browser or any JavaScript environment, no installation required. It packages SQLite as a single file you can load over the web and interact with programmatically. At a technical level, the project takes the standard SQLite shell (version 3.44) and compiles it into WebAssembly using a toolchain called WASI. WebAssembly is a format that lets code written in languages like C run efficiently in browsers and other environments. Once you load the compiled file, you can run SQLite commands and read the output through JavaScript callbacks. The README shows an example using the Runno runtime, where you start SQLite, pass it arguments like you would on a command line, and receive the results through functions you define. This would be useful for developers building interactive web pages that need a real SQL database without relying on a backend server. For example, an online SQL tutorial could let users practice queries entirely in the browser, or a data-focused web app could run complex queries on data it already has locally. It brings the full power of SQLite's query engine to environments where installing software isn't possible. The project has some limitations worth noting. There is no file I/O support, meaning SQLite cannot read from or write to files on disk, everything happens in memory within the session. A couple of internal commands that interact with the operating system, like .shell and .system, are also disabled, which makes sense given the sandboxed nature of browser environments. The project is MIT licensed, while SQLite itself is in the public domain.

Yoink these prompts

Prompt 1
Load the sqlite-wasi WebAssembly file in a web page, start the SQLite shell, run a CREATE TABLE and INSERT statement, then query the results and display them in an HTML table using JavaScript callbacks.
Prompt 2
Use the Runno runtime to run sqlite-wasi, pass command-line arguments to open an in-memory database, execute a SELECT query, and capture the output through a custom callback function.
Prompt 3
Build a simple browser-based SQL playground that loads sqlite-wasi, lets users type SQL queries into a textarea, executes them, and shows the formatted results below.

Frequently asked questions

wtf is sqlite-wasi?

A single-file WebAssembly build of SQLite that runs entirely in the browser or any JavaScript environment, letting you execute real SQL queries with no installation or backend server required.

What language is sqlite-wasi written in?

Mainly C. The stack also includes C, WebAssembly, WASI.

Is sqlite-wasi actively maintained?

Dormant — no commits in 2+ years (last push 2024-01-03).

What license does sqlite-wasi use?

Use freely for any purpose, including commercial use, as long as you keep the copyright notice.

How hard is sqlite-wasi to set up?

Setup difficulty is rated easy, with roughly 5min to a first successful run.

Who is sqlite-wasi for?

Mainly developer.

View the repo → Decode another repo

This repo across BitVibe Labs

Don't trust strangers blindly. Verify against the repo.