HackerReposA FIELD GUIDE TO OPEN SOURCE
ProSponsor the shelf♧ 0
← Back to top all-time
rhashimoto
wa-sqlite
JavaScript2022–2026
rhashimoto / wa-sqlite

wa-sqlite

WebAssembly SQLite with support for browser storage extensions

14Distinct people
19Mentions
1Explicit recommenders
1.4KGitHub stars
REPOSITORY AT A GLANCE

What to know before exploring

What it is

WebAssembly SQLite with support for browser storage extensions

GitHub

Where it is used

No documented product use was verified in the last source check.

What people are saying

You do not want to use IndexedDB, you should avoid IndexedDB if you can make live work without it. IndexedDB rows need to be very coarse grained, each operation with the…

jitl used a recommendation phrase. One indexed comment matches. This is a phrase match, not a verdict.

No classified warning is attached to this page. Read the discussions before treating silence as approval.

Also in these discussions

Mentioned in the same Hacker News threads. That is not proof they are substitutes.

This week on Hacker News

Nov 7–Nov 14 UTC · Direct repository links and separately labeled related project stories. Indexed through 11/14/2026, 1:49:46 PM UTC.

No direct repository links were found in the indexed HN discussions over the past seven days. Older discussions are available below.

Mentions over time

HN mentions by year19 dated mentions

Observed mentions: 2022-09-16 21:26:15 UTC to 2026-05-13 17:33:23 UTC.

02468102022-01-01 00:00:00 UTC to 2023-01-01 00:00:00 UTC (exclusive): 1 mentions; 1 submissions, 0 comments20222023-01-01 00:00:00 UTC to 2024-01-01 00:00:00 UTC (exclusive): 6 mentions; 1 submissions, 5 comments2024-01-01 00:00:00 UTC to 2025-01-01 00:00:00 UTC (exclusive): 10 mentions; 1 submissions, 9 comments20242025-01-01 00:00:00 UTC to 2026-01-01 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2026-01-01 00:00:00 UTC to 2027-01-01 00:00:00 UTC (exclusive): 2 mentions; 0 submissions, 2 comments. Incomplete calendar period.2026*

* An incomplete calendar period is marked with an outlined bar. Its count is not directly comparable with a full period.

Counts come from the repository’s dated source evidence. Index cutoff: 2026-11-02 08:16:59 UTC.

View mention counts and date ranges
UTC ranges include their start and exclude their end. Select a period to filter the source evidence.
PeriodStart (UTC)End (exclusive, UTC)MentionsSubmissionsComments
20222022-01-01 00:00:00 UTC2023-01-01 00:00:00 UTC110
20232023-01-01 00:00:00 UTC2024-01-01 00:00:00 UTC615
20242024-01-01 00:00:00 UTC2025-01-01 00:00:00 UTC1019
20252025-01-01 00:00:00 UTC2026-01-01 00:00:00 UTC000
2026 (partial)2026-01-01 00:00:00 UTC2027-01-01 00:00:00 UTC202

What Hacker News says

19 sources
That's good to know, thanks! It makes this quite realistic, which might mean a good/great OPFS VFS (like Roy's) actually starts to make sense. https://github.com/rhashimoto/wa-sqlite/discussions Unfortunately I'm not knowledgeable enough on the browser side of things to advance something like that, and have quite a bit on my plate already. But if there's interest I can help demystify the SQLite/VFS side of things. Feel free to (e.g.) open a GitHub discussion on my repo to track this.
In What if the browser was the server?
Hi all! I wanted to share a library I wrote that I think is needed to make OPFS actually useful. For context, OPFS is the Origin Private File System, giving your app a orgin-scoped high performance file system, ideal for stuff like sqlite or data intensive local-first apps. However, if you have multiple windows or tabs, using the same FileHandle will break your app, since there can only be one FileHandle per file. This library attempts to fix this by doing some MessagePort acrobatics between tabs, and keeps only one worker alive managing access to the file system. It’s informed by this discussion on wa-sqlite: https://github.com/rhashimoto/wa-sqlite/discussions/81 Hope somebody will find this useful!
In Show HN: Access OPFS from multiple tabs using a fake Shared Worker
jitl·Dec 30, 2024Recommendation phrase
You do not want to use IndexedDB, you should avoid IndexedDB if you can make live work without it. IndexedDB rows need to be very coarse grained, each operation with the IndexedDB API has very high overhead compared to something like walking a LSM tree in RocksDB or something. If the index does fit in memory, then the best move would be to store and load the entire index from a single or a few IndexedDB rows. If you need to index a lot of documents in a way that doesn't fit in memory, I recommend you consider sqlite3, stored in either OPFS or on IndexedDB, and use sqlite's FTS5 full text search stuff for the index. There are several sqlite backends available (see https://github.com/rhashimoto/wa-sqlite/tree/master/src/exam...), something like their IDB VFS will store each block in the sqlite file as a row in IndexedDB essentially batching
Read the rest
storage of the index rows into IDB rows for you (for more details read https://github.com/rhashimoto/wa-sqlite/blob/3c202615ed6f54e...)
In Libsearch: Simple index-free full-text search for JavaScript
I… really don't get this. The people on SQLite, employed to work on this full time for over a year, have this to say (on the link I posted above): “Because the WASM build does not have shared memory APIs, activating WAL requires that a client specifically activate exclusive-locking mode for a db handle immediately after opening it, before doing anything else with it… “WAL mode does not provide any concurrency benefits in this environment. On the contrary, the requirement for exclusive locking eliminates all concurrency support…” I personally worked to implement shared memory WAL for a server side Wasm port of SQLite. But random internet poster decides to “strongly expect it closer to a weekend or two of hacking.” Please, do me a favor and do spend that weekend or two for the benefit of the rest of us all. It'll sincerely be much appreciat
Read the rest
ed. PS: it was a random internet poster¹ (who's been posting in this thread) who helped me figure out how to implement shared memory WAL for my port. It still took way more than “a weekend or two.” So if you do figure out how to crack this, I'm sure that people who've been trying for the past year² will definitely appreciate it. 1: https://github.com/ncruces/go-sqlite3/discussions/69 2: https://github.com/rhashimoto/wa-sqlite
In Sqlite3 WebAssembly
I have been working on one. If you're interested in working on it or contributing, feel free to chime in here: https://github.com/rhashimoto/wa-sqlite/discussions/154 This essentially requires that we import the sqlite emscripten build via an extern C header in wasm bindgen, and then we need to re-implement the VFS in rust while compiling it in multi-threaded mode to allow for shared array buffer access. After that is all done, we will be able to access SQLite rows as raw wasm bytes. That gives us the ability to implement a rust-sqlite style wrapper or integration. There would still not be some of the niceties such as connection pooling, but in wasm you likely want to use the db in exclusive mode.
In Sqlite3 WebAssembly
> OPFS doesn’t come with graceful handling of concurrency out of the box. Developers should be aware of this and design around it. There's a multiple readers and writers proposal [0]. It's been "position: positive" by Firefox [1], implemented in Chrome [2], and ignored by Webkit [3] (of course). 0: https://github.com/whatwg/fs/blob/main/proposals/MultipleReadersWriters.md 1: https://github.com/mozilla/standards-positions/issues/861 2: https://chromestatus.com/feature/5172892632875008 3: https://github.com/WebKit/standards-positions/issues/238 Love the shoutout to Roy Hashimoto. He's been writing VFSs for SQLite-on-the-browser and perf testing them. He's recently wrote "IDBMirrorVFS", which "is a new example VFS that keeps all SQLite files in memory while persisting to IndexedDB". It has remarkable performance, of course.
Read the rest
https://github.com/rhashimoto/wa-sqlite/discussions/189 Also, looks like Roy takes advantage of the aforementioned proposal when he wrote `OPFSPermutedVFS`, which takes 2nd pace behind `IDBMirrorVFS` w/r/t perf. https://github.com/rhashimoto/wa-sqlite/blob/master/src/exam...
In How we sped up Notion in the browser with WASM SQLite

Ask HN: Wa-SQLite vs. Dexie, 2024

The word on the street is that https://github.com/rhashimoto/wa-sqlite is nearly production ready, closing in on the neat 1.0.0 release, with its IDBBatchAtomic engine highly recommended at https://www.powersync.com/blog/sqlite-persistence-on-the-web. You can try out the benchmark https://rhashimoto.github.io/wa-sqlite/demo/benchmarks.html. And the other contestant is Dexie, stable https://dexie.org/. If you were to branch into a new venture today, which one would you pick? And why?
2 points · Open discussion
It seems indeed very nice, the examples are clear and everything works from async. I tried with Deno, and now experimenting with my own VFS. It does seem to suffer from maintainer problems too though, and I don't blame Roy Hashimoto for that. I wouldn't want to maintain such an obvious wrapper when it should be a task for SQLite's team to upstream the changes. Roy Hashimoto doesn't want to maintain it as an NPM package for instance, as it is just an experiment: https://github.com/rhashimoto/wa-sqlite/issues/12 "Low traffic is a happy place - I don't have any motivation to mess with that."
In A future for SQL on the web (2021)
We now have absurd-sql, wa-sqlite, and the official SQLite project all running in a browser. Their tradeoffs are discussed here https://www.powersync.com/blog/sqlite-persistence-on-the-web That article was written in July, and in the intervening time, Chrome's announced an intent to ship "Multiple Readers and Writers in File System Access API" aka `readwrite-unsafe` [0] in v121 (stable in 2 weeks) which could help improve SQLite's performance even more. [0] https://chromestatus.com/feature/5172892632875008 Edit: It looks like wa-sqlite already has a prototype VFS taking advantage of the above feature https://github.com/rhashimoto/wa-sqlite/discussions/116
In A future for SQL on the web (2021)
Hey, thank you :) We currently use IndexedDB for the virtual filesystem underneath the wa-sqlite [1] WASM SQLite driver in the browser. But yup, that means a ~1.1MB WASM download. We'll definitely stay with SQLite in the client. One of our key principles is full SQL support (any Postgres supported SQL on the server, any SQLite supported SQL on the client). So we won't go pure IndexedDB without a database on top. There's a lot of cool stuff going on with OPFS and WASM SQLite atm, so the technical options are evolving fast. [1] https://github.com/rhashimoto/wa-sqlite
In Show HN: ElectricSQL, Postgres to SQLite active-active sync for local-first apps

Showing the 15 most recent of 19 sources. Enable JavaScript to search and browse every indexed mention.

MAKE YOURSELF AT HOME

A few shortcuts

/
Search the collection
?
Open this guide
Esc
Close dialogs and navigation

Your saved repositories and interests stay in this browser.