A cgo-free SQLite wrapper for Go that uses WebAssembly compilation to provide database/sql compatibility and direct SQLite API access.
go-sqlite3 is a Go module that provides bindings to SQLite without requiring cgo. It wraps a WebAssembly build of SQLite and translates it to Go using wasm2go, offering both a database/sql compatible driver and direct access to most of the C SQLite API. It solves the problem of cross-compilation and deployment complexities associated with cgo-based SQLite drivers.
Go developers who need SQLite database access in their applications, particularly those who want to avoid cgo dependencies for easier cross-compilation or deployment in restricted environments.
Developers choose go-sqlite3 because it provides full SQLite functionality without cgo, simplifying build processes and offering extensive platform support while maintaining competitive performance with alternative SQLite drivers.
Go bindings to SQLite using wasm2go
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Eliminates cgo dependencies, simplifying cross-compilation and deployment, as explicitly stated in the key features and philosophy sections.
Tested on a wide range of operating systems and architectures including Linux, macOS, Windows, BSD variants, illumos, and Solaris, detailed in the testing section.
Supports incremental BLOB I/O, nested transactions, virtual tables, JSON, full-text search, and geospatial queries, as listed in the advanced features with linked examples.
Provides a Go-based virtual file system implementation, enabling custom VFSes without C code, highlighted in the packages and VFS documentation.
Each database connection runs in a Wasm sandbox, increasing memory consumption compared to cgo-based alternatives, as admitted in the caveats section.
Certain OS and CPU combinations have some limitations, requiring users to consult the support matrix for compatibility, which adds complexity for edge cases.
The Wasm translation layer may introduce performance overhead in CPU-intensive scenarios, despite benchmarks showing competitive results, as noted in the performance section.