Hacker GitHub

← All repos

ncruces/go-sqlite3

View on GitHub ↗ ★ 1,132 Go

Go bindings to SQLite using wasm2go

84 mentions on Hacker News by 11 people: 6 stories, 78 comments · first 2023-04-08 · latest 2026-10-21

Mentions per year 84 mentions · busiest year 2025 (35)
20082026
  1. …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
    comment by ncruces · 2024-10-16 · in Sqlite3 WebAssembly
  2. …issue. I had to build a VFS from scratch to get my Wasm based SQLite driver into a usable shape. https://github.com/ncruces/go-sqlite3/blob/main/vfs/README.m...
    comment by ncruces · 2024-10-15 · in Sqlite3 WebAssembly
  3. For use in Golang, I really like ncruces wasm SQLite package - https://github.com/ncruces/go-sqlite3 . Unlike cznic's go package (which is great, btw), the wasm version works well on OpenBSD and the like.
    comment by koeng · 2024-10-15 · in Sqlite3 WebAssembly
  4. …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/tr…
    comment by ncruces · 2024-09-29 · in Some Go web dev notes
  5. Has been done and works pretty great: https://github.com/ncruces/go-sqlite3 . Though doesn’t convert the WASM to C, it runs the WASM in Wazero instead.
    comment by daenney · 2024-07-31 · in Building static binaries with Go on Linux
  6. …has been better than the modernc transpile and it’s probably sufficient for a lot of use cases. [1] https://github.com/ncruces/go-sqlite3
    comment by daenney · 2024-07-31 · in Building static binaries with Go on Linux
  7. …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…
  8. …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
  9. …that has both a low-level and a database/sql driver and which builds and runs everywhere Go does: https://github.com/ncruces/go-sqlite3
    comment by ncruces · 2024-02-07 · in Jsonfile: A Quick Hack for Tinkering
  10. …implement safe locking. Depending on your familiarity with Go, mine maybe easier to follow, or not. https://github.com/ncruces/go-sqlite3/blob/f1b00a9944730eaa9...
  11. …after the DB goes “live.” [1] https://www3.sqlite.org/src/file?name=src/memdb.c [2] https://pkg.go.dev/github.com/ncruces/go-sqlite3/vfs/memdb#s...
  12. …support both high and low level APIs. [1]: https://crawshaw.io/blog/go-and-sqlite [2]: https://pkg.go.dev/github.com/ncruces/go-sqlite3/driver#exam...
  13. …not import package embed, which embeds my WASM and sets this variable for you at init): https://pkg.go.dev/github.com/ncruces/go-sqlite3#pkg-variabl... Ping me on GitHub if you need help. Vector search is on my meters long todo list, but…
  14. …is to make sure building "the WASM BLOB" is easily reproducible with widely available tools: https://github.com/ncruces/go-sqlite3/blob/main/.github/work... I do apply some light patches to SQLite, but so far they've always cleanly…
  15. …in memory. You can then save the modified copy to disk using the backup API: [1]: https://pkg.go.dev/github.com/ncruces/go-sqlite3/vfs/memdb#e... [2]: https://gist.github.com/asukakenji/f15ba7e588ac42795f421b48b...
  16. The nitty gritty is in another answer. The commits implementing the new function cache are these two: https://github.com/ncruces/go-sqlite3/compare/0b093b7c...986... Creating good, representative, benchmarks is hard. I use speedtest1 [1]…
  17. …do. I could use ints rather than strings for function identifiers. I'll evaluate that later. [1]: https://github.com/ncruces/go-sqlite3/commit/964a42c76deb9c7...
    comment by ncruces · 2023-12-14 · in I benchmarked six Go SQLite drivers
  18. …I expect to cut numbers for CPU bound tests in half due to this mishap. So, thanks cvilsmeier! [1]: https://github.com/ncruces/go-sqlite3/commit/a9e32fd3f0b9f39... [2]: https://github.com/ncruces/go-sqlite3/commit/d862f47d95d522f... [3]:…
    comment by ncruces · 2023-12-14 · in I benchmarked six Go SQLite drivers
  19. …of SQLite built with much the same toolchain, which, hopefully, smokes out compiler bugs. [1]: https://github.com/ncruces/go-sqlite3/blob/main/.github/work...
    comment by ncruces · 2023-12-13 · in I benchmarked six Go SQLite drivers
  20. I'm the author or the WASM (+wazero) based github.com/ncruces/go-sqlite3. Happy to field questions. W.r.t. benchmark results. wazero's current compiler is somewhat naive, which may explain a large performance delta in CPU bound tests. A…
    comment by ncruces · 2023-12-13 · in I benchmarked six Go SQLite drivers
  21. You have options that don't use cgo. Disclaimer, I made the second one. https://modernc.org/sqlite https://github.com/ncruces/go-sqlite3
    comment by ncruces · 2023-12-07 · in JSONB has landed
  22. Disclosure: I'm working on alternative Cgo-less bindings for SQLite, using wazero. https://github.com/ncruces/go-sqlite3 One of the problems of the modernc approach (IMO) is that they're not just transpiling CPU/compute stuff, but entirely…
  23. Can you say more, like name your project? I'm building https://github.com/ncruces/go-sqlite3 and am a community maintainer of https://wazero.io I can cross compile SQLite into all platforms that Go OOB compiles too, with the caveat that…
  24. …replacing the OS layer (VFS) with portable Go code count? That's the elevator pitch (so far) for: https://github.com/ncruces/go-sqlite3/tree/main
  25. If you still have that itch to scratch, you can try: https://github.com/ncruces/go-sqlite3 You'll need to use the sqlite3_nolock build tag; concurrent writes will quickly corrupt your database. SetMaxOpenConns(1) is your friend. But it…
  26. …wazero instead) and want to avoid cgo, you may be interested in my wazero based SQLite bindings: https://github.com/ncruces/go-sqlite3
  27. …contained at the end. A couple examples of this: * https://github.com/jerbob92/go-pdfium-wasm * https://github.com/ncruces/go-sqlite3 More here: https://wazero.io/community/users/ Note that often times a lot of work is porting because not…
    comment by adrianfcole · 2023-05-07 · in FaaS in Go with WASM, WASI and Rust
  28. JFYI a Wasm approach here https://github.com/ncruces/go-sqlite3
    comment by anuraaga · 2023-04-08 · in Go port of SQLite without CGo