Files
sqlite3/embed/bcw2/init.go

25 lines
626 B
Go
Raw Permalink Normal View History

2024-08-09 00:48:25 +01:00
// Package bcw2 embeds SQLite into your application.
//
// Importing package bcw2 initializes the [sqlite3.Binary] variable
// with a build of SQLite that includes the [BEGIN CONCURRENT] and [Wal2] patches:
//
// import _ "github.com/ncruces/go-sqlite3/embed/bcw2"
//
// [BEGIN CONCURRENT]: https://sqlite.org/src/doc/begin-concurrent/doc/begin_concurrent.md
2024-10-07 14:42:09 +01:00
// [Wal2]: https://sqlite.org/cgi/src/doc/wal2/doc/wal2.md
2024-08-09 00:48:25 +01:00
package bcw2
import (
_ "embed"
2025-01-10 12:38:11 +00:00
"unsafe"
2024-08-09 00:48:25 +01:00
"github.com/ncruces/go-sqlite3"
)
//go:embed bcw2.wasm
2025-01-10 12:38:11 +00:00
var binary string
2024-08-09 00:48:25 +01:00
func init() {
2025-01-10 12:38:11 +00:00
sqlite3.Binary = unsafe.Slice(unsafe.StringData(binary), len(binary))
2024-08-09 00:48:25 +01:00
}