GoToSocial/vendor/github.com/ncruces/go-sqlite3/README.md

6.3 KiB

Go bindings to SQLite using Wazero

Go Reference Go Report Go Coverage

Go module github.com/ncruces/go-sqlite3 is a cgo-free SQLite wrapper.
It provides a database/sql compatible driver, as well as direct access to most of the C SQLite API.

It wraps a Wasm build of SQLite, and uses wazero as the runtime.
Go, wazero and x/sys are the only runtime dependencies 1.

Packages

Extensions

Advanced features

Caveats

This module replaces the SQLite OS Interface (aka VFS) with a pure Go implementation, which has advantages and disadvantages.

Read more about the Go VFS design here.

Testing

This project aims for high test coverage. It also benefits greatly from SQLite's and wazero's thorough testing.

The Go VFS is tested by running SQLite's mptest on Linux, macOS, Windows and FreeBSD.

Performance

Perfomance of the database/sql driver is competitive with alternatives.

The Wasm and VFS layers are also tested by running SQLite's speedtest1.

Alternatives


  1. anything else you find in go.mod is either a test dependency, or needed by one of the extensions. ↩︎