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

13 sources
My Go driver adds support for this by default, and I provide a simple API to enable it. I'm of the opinion that the VFS shim should ship by default, certainly on the CLI, because it still needs to be enabled for each DB, and all it takes is one instance that doesn't know about checksums to modify a checksummed DB for it to appear corrupt. https://github.com/ncruces/go-sqlite3/tree/main/vfs#checksum... Weirdly, databases created with the macOS version of the sqlite3 CLI reserve 12 bytes, for some reason, so you can't ever enable checksums on those DBs.
In SQLite does not do checksums
I'm the developer of the Wasm driver mentioned in the article: https://github.com/ncruces/go-sqlite3 The v0.20.x series (I just released v0.20.1) should improve this significantly. The driver was reserving lots of address space (with a protected, private, anonymous mapping) which doesn't play well with VMs and OSes that don't like to overcommit. It now reserves much less address space by default, and this can be reduced further. I also brought SQLite WAL mode support to 32-bit archs, to Windows and (through a build tag) to any OS that with an atomic mkdir (used for locking). Happy to discuss here, if you're looking for more in depth commentary.
In GoToSocial WASM-based SQLite driver and BSD
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
If you decide to use SQLite with one (single thread) writer pool and an other reader pool, this may help: https://github.com/bxcodec/dbresolver Also sometimes if I have two tables where I know I’ll never need to do a JOIN between them, I’ll just put them in separate databases so that I can connect to them independently. If this data belongs together and you're just doing this to improve concurrency, this may be a case where BEGIN CONCURRENT helps: https://sqlite.org/src/doc/begin-concurrent/doc/begin_concur... If you want to experiment with BEGIN CONCURRENT in Go you could do worse than try my SQLite driver: https://github.com/ncruces/go-sqlite3 Import this package to get the version with BEGIN CONCURRENT: https://github.com/ncruces/go-sqlite3/tree/main/embed/bcw2
In Some Go web dev notes
Yep, I just made it tweakable at build, which was always the intent, although I expect the default to be popular. https://github.com/ncruces/go-sqlite3/blob/67d859a5/vfs/adia... That's unfortunate about the default parameters, but note that you can also replace the KDF altogether (besides just not using it). You just need to implement this interface, with any HBSH construction and KDF: https://github.com/ncruces/go-sqlite3/blob/67d859a5/vfs/adia... If you keep the HBSH and change the KDF, your file format will be “compatible.”
In Show HN: Roast my SQLite encryption at-rest
My extension targets my Go SQLite bindings (the VFS is implemented in Go) [1]. This extension, and the wrapper, target public SQLite APIs, so if anyone wants to replace SQLite with libSQL, that should be easy. You simply need to include a little bit of glue C code that I append to the amalgamation, and use some SQLite compile options. I explicitly support building and providing your own, custom, Wasm SQLite "blob" (it just needs to include my glue code). As for Adiantum encryption, as I said, reimplementing this in C/C++/Rust to make it a loadable extension is perfectly viable, and would be compatible with libSQL, again because this uses only public SQLite APIs (that's the point, basically!) But this is predicated on it being a secure scheme (that's the feedback I was looking for this time around). PS: I've got nothing against Turso, or l
Read the rest
ibSQL. In fact I spent the last year perusing their virtual WAL API. The problem is that I found no documentation, nor any useful open source implementations of it. If there any I'd be very interested. So, thus far, I also don't have anything that drives towards libSQL. [1] https://github.com/ncruces/go-sqlite3
In Show HN: Roast my SQLite encryption at-rest
ncruces·Apr 30, 2024Submission

Show HN: Roast my SQLite encryption at-rest

SQLite encryption at-rest is a hot requested feature of both the “default” CGo driver [1] and the transpiled alternative driver [2]. So, this is a feature I wanted to bring to my own Wasm based Go driver/bindings [3]. Open-source SQLite encryption extensions have had a troubled last few years. For whatever reason, in 2020 the (undocumented) feature that made it easy to offer page-level encryption was removed [4]. Some solutions are stuck with SQLite 3.31.1, but Ulrich Telle stepped up with a VFS approach [5]. Still, their solution seemed harder than something I'd want to maintain, as it requires understanding the structure of what's being written to disk at the VFS layer. So, I looked at full disk encryption for something with less of an impedance mismatch. Specifically, I'm using the Adiantum tweakable and length-preserving encryption (w
Read the rest
ith 4K blocks, matching the default SQLite page size), and encrypting whole files (rather than page content). I'm not a cryptographer, so I'd really appreciate some roasting before release. There is nothing very Go specific about this (apart from the implementation) so if there are no obvious flaws, it may make sense to port it to C/Rust/etc and make it a loadable extension. [1] https://github.com/mattn/go-sqlite3/pull/1109 [2] https://gitlab.com/cznic/sqlite/-/issues/105 [3] https://github.com/ncruces/go-sqlite3/issues/55 [4] https://github.com/sqlite/sqlite/commit/b48c0d59 [5] https://github.com/utelle/SQLite3MultipleCiphers
99 points · Open discussion

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.