diff --git a/.github/workflows/repro.sh b/.github/workflows/repro.sh index debfd76..dbdf066 100755 --- a/.github/workflows/repro.sh +++ b/.github/workflows/repro.sh @@ -19,5 +19,5 @@ mkdir -p tools/ wait sqlite3/download.sh # Download SQLite -embed/build.sh # Build WASM +embed/build.sh # Build Wasm git diff --exit-code # Check diffs \ No newline at end of file diff --git a/README.md b/README.md index 1682770..62a1a2e 100644 --- a/README.md +++ b/README.md @@ -8,7 +8,7 @@ Go module `github.com/ncruces/go-sqlite3` is `cgo`-free [SQLite](https://sqlite. It provides a [`database/sql`](https://pkg.go.dev/database/sql) compatible driver, as well as direct access to most of the [C SQLite API](https://sqlite.org/cintro.html). -It wraps a [WASM](https://webassembly.org/) build of SQLite, and uses [wazero](https://wazero.io/) as the runtime.\ +It wraps a [Wasm](https://webassembly.org/) build of SQLite, and uses [wazero](https://wazero.io/) as the runtime.\ Go, wazero and [`x/sys`](https://pkg.go.dev/golang.org/x/sys) are the _only_ runtime dependencies. ### Packages @@ -77,7 +77,7 @@ This has benefits, but also comes with some drawbacks. #### Write-Ahead Logging -Because WASM does not support shared memory, +Because Wasm does not support shared memory, [WAL](https://sqlite.org/wal.html) support is [limited](https://sqlite.org/wal.html#noshm). To work around this limitation, SQLite is [patched](sqlite3/locking_mode.patch) @@ -131,7 +131,7 @@ on Linux, macOS, Windows and FreeBSD. Perfomance of the [`database/sql`](https://pkg.go.dev/database/sql) driver is [competitive](https://github.com/cvilsmeier/go-sqlite-bench) with alternatives. -The WASM and VFS layers are also tested by running SQLite's +The Wasm and VFS layers are also tested by running SQLite's [speedtest1](https://github.com/sqlite/sqlite/blob/master/test/speedtest1.c). ### Alternatives diff --git a/embed/README.md b/embed/README.md index c7a7ca2..a9367c4 100644 --- a/embed/README.md +++ b/embed/README.md @@ -1,6 +1,6 @@ -# Embeddable WASM build of SQLite +# Embeddable Wasm build of SQLite -This folder includes an embeddable WASM build of SQLite 3.45.1 for use with +This folder includes an embeddable Wasm build of SQLite 3.45.1 for use with [`github.com/ncruces/go-sqlite3`](https://pkg.go.dev/github.com/ncruces/go-sqlite3). The following optional features are compiled in: diff --git a/sqlite.go b/sqlite.go index c111c44..56ea68b 100644 --- a/sqlite.go +++ b/sqlite.go @@ -15,14 +15,14 @@ import ( "github.com/tetratelabs/wazero/api" ) -// Configure SQLite WASM. +// Configure SQLite Wasm. // -// Importing package embed initializes these +// Importing package embed initializes [Binary] // with an appropriate build of SQLite: // // import _ "github.com/ncruces/go-sqlite3/embed" var ( - Binary []byte // WASM binary to load. + Binary []byte // Wasm binary to load. Path string // Path to load the binary from. RuntimeConfig wazero.RuntimeConfig @@ -274,7 +274,7 @@ func (a *arena) new(size uint64) uint32 { } func (a *arena) bytes(b []byte) uint32 { - if b == nil { + if (*[0]byte)(b) == nil { return 0 } ptr := a.new(uint64(len(b))) diff --git a/sqlite3/sqlite_cfg.h b/sqlite3/sqlite_cfg.h index c4f9305..7da18b3 100644 --- a/sqlite3/sqlite_cfg.h +++ b/sqlite3/sqlite_cfg.h @@ -57,8 +57,8 @@ #define SQLITE_ENABLE_ATOMIC_WRITE #define SQLITE_ENABLE_BATCH_ATOMIC_WRITE -// Because WASM does not support shared memory, -// SQLite disables WAL for WASM builds. +// Because Wasm does not support shared memory, +// SQLite disables WAL for Wasm builds. // We patch SQLite to use exclusive locking mode instead. // https://sqlite.org/wal.html#noshm #undef SQLITE_OMIT_WAL