ncruces / go-sqlite3

Go bindings to SQLite using wazero
https://pkg.go.dev/github.com/ncruces/go-sqlite3
MIT License
402 stars 12 forks source link

Launching the SQLite shell #110

Closed daenney closed 2 months ago

daenney commented 2 months ago

One nice benefit of this library is that there's no need for the target system to have sqlite installed, but as such the sqlite3 CLI will also be absent.

I've been looking at if it's possible to invoke the sqlite shell from this library, with the idea of embedding that as a subcommand in my own CLI. But I don't think that's possible currently?

ncruces commented 2 months ago

No, the SQLite shell is not a library, but an entire additional code base using the library.

I could, potentially, compile it to WASI but:

So there are challenges, this is a project on its own. If you're interested, I definitely wouldn't stop anyone from working on it; I'll be as helpful as possible. You can look for places where I compile speedtest1 and mptest for how to get started.

But I suspect static linking the shell with musl might be more productive/satisfying? I'd investigate the zig toolchain for cross compilation.

daenney commented 2 months ago

Right yeah, that makes sense. Hadn't thought of using the zig toolchain, but that's a good point.

I'll fiddle around with it at some point and see if I can get anywhere.