SQLite transactions and virtual tables

104 pointsposted 10 months ago
by preetamjinka

9 Comments

dvektor

10 months ago

Love to see someone writing about vtabs, I implemented vtab support for a rust reimplementation of sqlite so I've recently learned a tremendous amount about them. They are very powerful and probably under utilized.

Jupe

10 months ago

Interesting. But this uses mattn's go-sqlite3 package, which is CGO.

Is this a normal/expected requirement in modern GO?

preetamjinka

10 months ago

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.

hamburglar

10 months ago

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.

cryptonector

10 months ago

I bet SQLite3 builds on more platforms than Go.

catlifeonmars

10 months ago

It’s not about the build platform, it’s about the execution platform and not having to have a toolchain for every platform. This is especially relevant in the embedded space.