2024-05-27 15:46:15 +00:00
|
|
|
// Package embed embeds SQLite into your application.
|
|
|
|
//
|
|
|
|
// Importing package embed initializes the [sqlite3.Binary] variable
|
|
|
|
// with an appropriate build of SQLite:
|
|
|
|
//
|
|
|
|
// import _ "github.com/ncruces/go-sqlite3/embed"
|
|
|
|
package embed
|
|
|
|
|
|
|
|
import (
|
|
|
|
_ "embed"
|
2025-01-14 18:30:55 +00:00
|
|
|
"unsafe"
|
2024-05-27 15:46:15 +00:00
|
|
|
|
|
|
|
"github.com/ncruces/go-sqlite3"
|
|
|
|
)
|
|
|
|
|
|
|
|
//go:embed sqlite3.wasm
|
2025-01-14 18:30:55 +00:00
|
|
|
var binary string
|
2024-05-27 15:46:15 +00:00
|
|
|
|
|
|
|
func init() {
|
2025-01-14 18:30:55 +00:00
|
|
|
sqlite3.Binary = unsafe.Slice(unsafe.StringData(binary), len(binary))
|
2024-05-27 15:46:15 +00:00
|
|
|
}
|