PS: The mattn CGO driver actually doesn't seem to support wrapping the xBegin/xSync/xRollback/xCommit methods. Mine actually does, although it's largely untested, as I haven't needed this yet.
We use mattn's go-sqlite3 in our SaaS product. It's not ideal from a toolchain perspective (i.e. cross compiling becomes a little annoying, especially with multi-arch Docker images) but once you get across that hurdle, we haven't run into any major problems with cgo.
The problem with cgo is it reduces portability, not that it causes issues. If whatever C you’re invoking doesn’t build on your architecture or if you need to cross-compile (last I checked), you’re out of luck.
ncruces|10 months ago
You can have a look at a bunch of examples in my extensions folder: https://github.com/ncruces/go-sqlite3/tree/main/ext
PS: The mattn CGO driver actually doesn't seem to support wrapping the xBegin/xSync/xRollback/xCommit methods. Mine actually does, although it's largely untested, as I haven't needed this yet.
preetamjinka|10 months ago
hamburglar|10 months ago
cryptonector|10 months ago
ncruces|10 months ago
https://modernc.org/sqlite which preprocesses and transpiles the amalgamation from C to Go.
https://github.com/ncruces/go-sqlite3 which runs a Wasm build of SQLite through a pure Go Wasm runtime.