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

Integrate with sqlite-zstd #105

Closed franchb closed 2 months ago

franchb commented 2 months ago

Is it possible to add sqlite-zstd extension to ncruces/go-sqlite3 WASM driver?

ncruces commented 2 months ago

Maybe, but it really depends on what you mean.

Any extension you can compile and statically link into your own Wasm, is probably fair game.

I can't give specific instructions for sqlite-zstd, but you can check how sqlite3.wasm is built, and how various extensions are linked and initialized. Then it's just a matter of using your own Wasm.

If, however, want you really want is readonly compressed databases, my suggestion is that you compress your entire database with Zstandard Seekable Format, and use zstd-seekable-format-go with the reader VFS.

franchb commented 2 months ago

Thank you! I'll give zstd-seekable-format-go a shot.

ncruces commented 2 months ago

Please report any feedback!