3 ms·
The same author ("cznic") has also built a C-to-Go compiler/transpiler and used it to convert SQLite to pure Go source, so that it doesn't require CGo: https://
by benhoyt 5y ago
The same author ("cznic") has also built a C-to-Go compiler/transpiler and used it to convert SQLite to pure Go source, so that it doesn't require CGo: https://gitlab.com/cznic/sqlite https://gitlab.com/cznic/sqlite ... the converted Go code is pretty much unreadable and it's somewhat slower than SQLite via CGo. But a pretty neat idea! I use it in one of my projects and it works well.
- eatonphil 5y agoI saw that recently. I would be interested in using it but it wasn't clear what level of compatibility it has or how many tests it's passing/not passing.
- benhoyt 5y agoYeah, fair concern. I saw a while back (looks like Aug 2020) that he got all 928,000 SQLite tests passing -- search for "0 errors out of" on this page: https://pkg.go.dev/modernc.org/sqlite#section-readme https://pkg.go.dev/modernc.org/sqlite#section-readme
- eatonphil 5y agoWow! I'd almost trust it more if only 99% of tests were passing rather than 100% of tests passing. :)
- mongol 5y agoI think there are many tests used for testing sqlite that are not public. Hipp said so in a podcast I recall.
- Beltalowda 5y agoThere's TH3[1], and you indeed need to purchase a license for that. The price is listed as "call"[2], so I guess it's not cheap. [1]: https://sqlite.org/th3.html https://sqlite.org/th3.html [2]: http://www.hwaci.com/sw/sqlite/prosupport.html http://www.hwaci.com/sw/sqlite/prosupport.html
- oefrha 5y agoNice. I tried to cross-compile a Go app using SQLite for darwin/arm64 a couple months back and couldn’t figure it out for the life of me. Ended up just shipping a darwin/amd64 binary and letting Rosetta handle it. Will give this a spin when I have time.
- preetamjinka 5y agoI should write a blog post this but here’s what I do in GitHub Actions for a Go binary that uses SQLite: https://github.com/crossjoin-io/crossjoin/blob/main/.github/workflows/go.yml https://github.com/crossjoin-io/crossjoin/blob/main/.github/...