HackerReposA FIELD GUIDE TO OPEN SOURCE
ProSponsor the shelf♧ 0
← Back to top all-time
ncruces
go-sqlite3
Go2023–2026
ncruces / go-sqlite3

go-sqlite3

Go bindings to SQLite using wasm2go

11Distinct people
84Mentions
0Explicit recommenders
1.1KGitHub stars
REPOSITORY AT A GLANCE

What to know before exploring

What it is

Go bindings to SQLite using wasm2go

GitHub

Where it is used

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

What people are saying

No recommendation phrase was found in the indexed comments.

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 8–Nov 15 UTC · Direct repository links and separately labeled related project stories. Indexed through 11/15/2026, 2:04:58 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 year84 dated mentions

Observed mentions: 2023-04-08 05:04:20 UTC to 2026-10-21 22:17:16 UTC.

01020302023-01-01 00:00:00 UTC to 2024-01-01 00:00:00 UTC (exclusive): 21 mentions; 2 submissions, 19 comments20232024-01-01 00:00:00 UTC to 2025-01-01 00:00:00 UTC (exclusive): 13 mentions; 1 submissions, 12 comments20242025-01-01 00:00:00 UTC to 2026-01-01 00:00:00 UTC (exclusive): 35 mentions; 3 submissions, 32 comments2026-01-01 00:00:00 UTC to 2027-01-01 00:00:00 UTC (exclusive): 15 mentions; 0 submissions, 15 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
20232023-01-01 00:00:00 UTC2024-01-01 00:00:00 UTC21219
20242024-01-01 00:00:00 UTC2025-01-01 00:00:00 UTC13112
20252025-01-01 00:00:00 UTC2026-01-01 00:00:00 UTC35332
2026 (partial)2026-01-01 00:00:00 UTC2027-01-01 00:00:00 UTC15015

What Hacker News says

35 sources
Started as fun "what if" side project, but kept me interested for 3 years now. Turns out it's actually useful. It's pretty portable: with some caveats, it works pretty much everywhere Go does. Performance is bad outside amd64/arm64, but for most popular OS/platforms it's fine. See this for an overall picture (these are the platforms I test): https://github.com/ncruces/go-sqlite3/wiki/Support-matrix I bet you could do the similar with pglite, but this (and helping out with wazero) already consumes all my spare time.
In Epsilon: A WASM virtual machine written in Go
I knew I remember your name working with something of sqlite and golang https://github.com/ncruces/go-sqlite3 Man I really enjoy golang and cross portability and wazero + sqlite could still be cross portable which is super fascinating What are your thoughts on https://github.com/electric-sql/pglite (postgres in wasm)? Also what were the goal behind a pure golang solution via wazero + wasm sqlite as you had made? Was it cross platform support, if so, what are your thoughts on zig, I have seen a project use zig + golang to create cross platform C language support but I think that adding zig into the picture complicates the build process so there are tradeoffs and I am interested to hear your opinions about it!
In Epsilon: A WASM virtual machine written in Go
SQLite directly against S3 is workable if you mean querying a read-only database. For example, from Go, you could use my driver, and point it to a database file stored in S3 using this: https://pkg.go.dev/github.com/ncruces/go-sqlite3/vfs/readerv... For read-write it's a terrible idea. Object storage assumes objects are immutable. There may be some support for appends, but modifying the middle of an object in place involves copying the entire thing. What is on the verge of becoming viable is to use Litestream to do asynchronous replication to S3, and have read replicas that stream the data directly from S3. But what's stored in S3 isn't a database file, but a format created for the purpose called LTX.
In Beyond the SQLite single-writer limitation with concurrent writes
I've been trying to get a headstart on the lightweight read replicas for my Go SQLite driver and, yes, there are issues. https://fly.io/blog/litestream-revamped/#lightweight-read-re... But the concept is really cool, and it's workable. I already have a version that mostly works. https://github.com/ncruces/go-sqlite3/tree/litestream/litest... With Litestream v0.5.0 doing the replication, you'll get some transient read failures that really shouldn't happen. If you build Litestream from head (or wait for v0.5.1), that'll be fixed. You'll still have similar issues around the time of a snapshot, if you keep only one snapshot. Other than that, I'm pretty confident it just works. But the performance probably sucks. I need to add a layer of caching. But that's it.
In Hold Off on Litestream 0.5.0
The way they got multi-writer working is a bit too adventurous for me. It involves fiddling the database header to ensure you can keep track of the read-set from the VFS layer, by convincing SQLite to drop its page cache at the start of every transaction. Other than that, a MVCC VFS is relatively straightforward. Here's an in-memory experiment if a few hundred lines of Go: https://github.com/ncruces/go-sqlite3/blob/v0.29.0/vfs/mvcc/... I haven't settled on what's a good storage layer for something like this.
In Rails on SQLite: new ways to cause outages
My driver (Wasm based) does many of these things by default. Foreign keys are default enabled, default synchronous mode is FULL for rollback and NORMAL for WAL, shared cache is disabled, the default busy timeout when using database/sql is 60 seconds. About the default huge busy timeout: my driver can easily afford this because context cancellation actually works and interrupt both long running queries and filesystem locks. I don't think the mattn driver can use a (e.g.) WithDeadline(100ms) context to interrupt early a connection blocked on a busy timeout of 5 seconds: your goroutine will be stuck in a Cgo loop without anything to interrupt it. Doing this properly requires a custom busy handler, the overhead of which might be to big for Cgo (not sure). Having done this, I also implemented the Ruby approach to improve tail latencies: https:
Read the rest
//fractaledmind.com/2023/12/06/sqlite-on-rails-improvi... Another important thing that I don't think mattn does, is have a default transaction "kind" and then allow specific transactions to override it. For SQLite, arguably, the default transaction should be immediate, with only read-only transactions being deferred. I make it possible to pick the transaction type with BeginTx. Also, recommendations on PRAGMA optimize vary. If you do it when opening connections, you're supposed to use specific flags: optimize uses previous work by the connection to guide what to do, and there's none at this point. This also adds latency to opening connections. Another possibility is doing it when a connection is closed. My driver makes adding a close callback easy. https://github.com/ncruces/go-sqlite3
In Go and SQLite Best Practices

Showing the 15 most recent of 35 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.