diff --git a/embed/README.md b/embed/README.md index efc0465..1ddb985 100644 --- a/embed/README.md +++ b/embed/README.md @@ -19,11 +19,22 @@ The following optional features are compiled in: - [uint](https://github.com/sqlite/sqlite/blob/master/ext/misc/uint.c) - [time](../sqlite3/time.c) -See the [configuration options](../sqlite3/sqlite_cfg.h), +See the [configuration options](../sqlite3/sqlite_opt.h), and [patches](../sqlite3) applied. Built using [`wasi-sdk`](https://github.com/WebAssembly/wasi-sdk), and [`binaryen`](https://github.com/WebAssembly/binaryen). The build is easily reproducible, and verifiable, using -[Artifact Attestations](https://github.com/ncruces/go-sqlite3/attestations). \ No newline at end of file +[Artifact Attestations](https://github.com/ncruces/go-sqlite3/attestations). + +### Customizing the build + +You can use your own custom build of SQLite. + +Examples of custom builds of SQLite are: +- [`github.com/ncruces/go-sqlite3/embed/bcw2`](https://github.com/ncruces/go-sqlite3/tree/main/embed/bcw2) + built from a branch supporting [`BEGIN CONCURRENT`](https://sqlite.org/src/doc/begin-concurrent/doc/begin_concurrent.md) + and [Wal2](https://www.sqlite.org/cgi/src/doc/wal2/doc/wal2.md). +- [`github.com/asg017/sqlite-vec-go-bindings/ncruces`](https://github.com/asg017/sqlite-vec-go-bindings) + which includes the [`sqlite-vec`](https://github.com/asg017/sqlite-vec) vector search extension. \ No newline at end of file diff --git a/embed/bcw2/README.md b/embed/bcw2/README.md index b7c1e16..f8b3167 100644 --- a/embed/bcw2/README.md +++ b/embed/bcw2/README.md @@ -1,7 +1,7 @@ # Embeddable Wasm build of SQLite This folder includes an embeddable Wasm build of SQLite 3.46.0, including the experimental -[BEGIN CONCURRENT](https://sqlite.org/src/doc/begin-concurrent/doc/begin_concurrent.md) and +[`BEGIN CONCURRENT`](https://sqlite.org/src/doc/begin-concurrent/doc/begin_concurrent.md) and [Wal2](https://www.sqlite.org/cgi/src/doc/wal2/doc/wal2.md) patches. > [!IMPORTANT] diff --git a/embed/bcw2/build.sh b/embed/bcw2/build.sh index 1bc695c..ee21ddc 100755 --- a/embed/bcw2/build.sh +++ b/embed/bcw2/build.sh @@ -7,7 +7,7 @@ ROOT=../../ BINARYEN="$ROOT/tools/binaryen/bin" WASI_SDK="$ROOT/tools/wasi-sdk/bin" -trap 'rm -rf build sqlite bcw2.tmp' EXIT +trap 'rm -rf build/ sqlite/ bcw2.tmp' EXIT mkdir -p build/ext/ cp "$ROOT"/sqlite3/*.[ch] build/ diff --git a/embed/build.sh b/embed/build.sh index a719f8b..6141efd 100755 --- a/embed/build.sh +++ b/embed/build.sh @@ -7,6 +7,8 @@ ROOT=../ BINARYEN="$ROOT/tools/binaryen/bin" WASI_SDK="$ROOT/tools/wasi-sdk/bin" +trap 'rm -f sqlite3.tmp' EXIT + "$WASI_SDK/clang" --target=wasm32-wasi -std=c23 -g0 -O2 \ -Wall -Wextra -Wno-unused-parameter -Wno-unused-function \ -o sqlite3.wasm "$ROOT/sqlite3/main.c" \ @@ -23,7 +25,6 @@ WASI_SDK="$ROOT/tools/wasi-sdk/bin" -DSQLITE_CUSTOM_INCLUDE=sqlite_opt.h \ $(awk '{print "-Wl,--export="$0}' exports.txt) -trap 'rm -f sqlite3.tmp' EXIT "$BINARYEN/wasm-ctor-eval" -g -c _initialize sqlite3.wasm -o sqlite3.tmp "$BINARYEN/wasm-opt" -g --strip --strip-producers -c -O3 \ sqlite3.tmp -o sqlite3.wasm \ diff --git a/gormlite/go.mod b/gormlite/go.mod index 710f29e..68e2bc2 100644 --- a/gormlite/go.mod +++ b/gormlite/go.mod @@ -14,6 +14,6 @@ require ( github.com/jinzhu/now v1.1.5 // indirect github.com/ncruces/julianday v1.0.0 // indirect github.com/tetratelabs/wazero v1.7.3 // indirect - golang.org/x/sys v0.23.0 // indirect + golang.org/x/sys v0.24.0 // indirect golang.org/x/text v0.17.0 // indirect ) diff --git a/gormlite/go.sum b/gormlite/go.sum index 56b7aef..c66ab33 100644 --- a/gormlite/go.sum +++ b/gormlite/go.sum @@ -8,8 +8,8 @@ github.com/ncruces/julianday v1.0.0 h1:fH0OKwa7NWvniGQtxdJRxAgkBMolni2BjDHaWTxqt github.com/ncruces/julianday v1.0.0/go.mod h1:Dusn2KvZrrovOMJuOt0TNXL6tB7U2E8kvza5fFc9G7g= github.com/tetratelabs/wazero v1.7.3 h1:PBH5KVahrt3S2AHgEjKu4u+LlDbbk+nsGE3KLucy6Rw= github.com/tetratelabs/wazero v1.7.3/go.mod h1:ytl6Zuh20R/eROuyDaGPkp82O9C/DJfXAwJfQ3X6/7Y= -golang.org/x/sys v0.23.0 h1:YfKFowiIMvtgl1UERQoTPPToxltDeZfbj4H7dVUCwmM= -golang.org/x/sys v0.23.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.24.0 h1:Twjiwq9dn6R1fQcyiK+wQyHWfaz/BJB+YIpzU/Cv3Xg= +golang.org/x/sys v0.24.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/text v0.17.0 h1:XtiM5bkSOt+ewxlOE/aE/AKEHibwj/6gvWMl9Rsh0Qc= golang.org/x/text v0.17.0/go.mod h1:BuEKDfySbSR4drPmRPG/7iBdf8hvFMuRexcpahXilzY= gorm.io/gorm v1.25.11 h1:/Wfyg1B/je1hnDx3sMkX+gAlxrlZpn6X0BXRlwXlvHg= diff --git a/util/vtabutil/parse/build.sh b/util/vtabutil/parse/build.sh index b30953c..ac587e6 100755 --- a/util/vtabutil/parse/build.sh +++ b/util/vtabutil/parse/build.sh @@ -7,6 +7,8 @@ ROOT=../../../ BINARYEN="$ROOT/tools/binaryen/bin" WASI_SDK="$ROOT/tools/wasi-sdk/bin" +trap 'rm -f sql3parse_table.tmp' EXIT + "$WASI_SDK/clang" --target=wasm32-wasi -std=c23 -g0 -Oz \ -Wall -Wextra -o sql3parse_table.wasm main.c \ -mexec-model=reactor \ @@ -18,7 +20,6 @@ WASI_SDK="$ROOT/tools/wasi-sdk/bin" -Wl,--import-undefined \ -Wl,--export=sql3parse_table -trap 'rm -f sql3parse_table.tmp' EXIT "$BINARYEN/wasm-ctor-eval" -c _initialize sql3parse_table.wasm -o sql3parse_table.tmp "$BINARYEN/wasm-opt" --strip --strip-debug --strip-producers -c -Oz \ sql3parse_table.tmp -o sql3parse_table.wasm \