init.go 431 B

123456789101112131415161718192021
  1. // Package embed embeds SQLite into your application.
  2. //
  3. // Importing package embed initializes the [sqlite3.Binary] variable
  4. // with an appropriate build of SQLite:
  5. //
  6. // import _ "github.com/ncruces/go-sqlite3/embed"
  7. package embed
  8. import (
  9. _ "embed"
  10. "unsafe"
  11. "github.com/ncruces/go-sqlite3"
  12. )
  13. //go:embed sqlite3.wasm
  14. var binary string
  15. func init() {
  16. sqlite3.Binary = unsafe.Slice(unsafe.StringData(binary), len(binary))
  17. }