File tree Expand file tree Collapse file tree 7 files changed +22
-9
lines changed Expand file tree Collapse file tree 7 files changed +22
-9
lines changed Original file line number Diff line number Diff line change @@ -19,11 +19,22 @@ The following optional features are compiled in:
19
19
- [ uint] ( https://github.com/sqlite/sqlite/blob/master/ext/misc/uint.c )
20
20
- [ time] ( ../sqlite3/time.c )
21
21
22
- See the [ configuration options] ( ../sqlite3/sqlite_cfg .h ) ,
22
+ See the [ configuration options] ( ../sqlite3/sqlite_opt .h ) ,
23
23
and [ patches] ( ../sqlite3 ) applied.
24
24
25
25
Built using [ ` wasi-sdk ` ] ( https://github.com/WebAssembly/wasi-sdk ) ,
26
26
and [ ` binaryen ` ] ( https://github.com/WebAssembly/binaryen ) .
27
27
28
28
The build is easily reproducible, and verifiable, using
29
- [ Artifact Attestations] ( https://github.com/ncruces/go-sqlite3/attestations ) .
29
+ [ Artifact Attestations] ( https://github.com/ncruces/go-sqlite3/attestations ) .
30
+
31
+ ### Customizing the build
32
+
33
+ You can use your own custom build of SQLite.
34
+
35
+ Examples of custom builds of SQLite are:
36
+ - [ ` github.com/ncruces/go-sqlite3/embed/bcw2 ` ] ( https://github.com/ncruces/go-sqlite3/tree/main/embed/bcw2 )
37
+ built from a branch supporting [ ` BEGIN CONCURRENT ` ] ( https://sqlite.org/src/doc/begin-concurrent/doc/begin_concurrent.md )
38
+ and [ Wal2] ( https://www.sqlite.org/cgi/src/doc/wal2/doc/wal2.md ) .
39
+ - [ ` github.com/asg017/sqlite-vec-go-bindings/ncruces ` ] ( https://github.com/asg017/sqlite-vec-go-bindings )
40
+ which includes the [ ` sqlite-vec ` ] ( https://github.com/asg017/sqlite-vec ) vector search extension.
Original file line number Diff line number Diff line change 1
1
# Embeddable Wasm build of SQLite
2
2
3
3
This folder includes an embeddable Wasm build of SQLite 3.46.0, including the experimental
4
- [ BEGIN CONCURRENT] ( https://sqlite.org/src/doc/begin-concurrent/doc/begin_concurrent.md ) and
4
+ [ ` BEGIN CONCURRENT ` ] ( https://sqlite.org/src/doc/begin-concurrent/doc/begin_concurrent.md ) and
5
5
[ Wal2] ( https://www.sqlite.org/cgi/src/doc/wal2/doc/wal2.md ) patches.
6
6
7
7
> [ !IMPORTANT]
Original file line number Diff line number Diff line change @@ -7,7 +7,7 @@ ROOT=../../
7
7
BINARYEN=" $ROOT /tools/binaryen/bin"
8
8
WASI_SDK=" $ROOT /tools/wasi-sdk/bin"
9
9
10
- trap ' rm -rf build sqlite bcw2.tmp' EXIT
10
+ trap ' rm -rf build/ sqlite/ bcw2.tmp' EXIT
11
11
12
12
mkdir -p build/ext/
13
13
cp " $ROOT " /sqlite3/* .[ch] build/
Original file line number Diff line number Diff line change 7
7
BINARYEN=" $ROOT /tools/binaryen/bin"
8
8
WASI_SDK=" $ROOT /tools/wasi-sdk/bin"
9
9
10
+ trap ' rm -f sqlite3.tmp' EXIT
11
+
10
12
" $WASI_SDK /clang" --target=wasm32-wasi -std=c23 -g0 -O2 \
11
13
-Wall -Wextra -Wno-unused-parameter -Wno-unused-function \
12
14
-o sqlite3.wasm " $ROOT /sqlite3/main.c" \
@@ -23,7 +25,6 @@ WASI_SDK="$ROOT/tools/wasi-sdk/bin"
23
25
-DSQLITE_CUSTOM_INCLUDE=sqlite_opt.h \
24
26
$( awk ' {print "-Wl,--export="$0}' exports.txt)
25
27
26
- trap ' rm -f sqlite3.tmp' EXIT
27
28
" $BINARYEN /wasm-ctor-eval" -g -c _initialize sqlite3.wasm -o sqlite3.tmp
28
29
" $BINARYEN /wasm-opt" -g --strip --strip-producers -c -O3 \
29
30
sqlite3.tmp -o sqlite3.wasm \
Original file line number Diff line number Diff line change @@ -14,6 +14,6 @@ require (
14
14
github.com/jinzhu/now v1.1.5 // indirect
15
15
github.com/ncruces/julianday v1.0.0 // indirect
16
16
github.com/tetratelabs/wazero v1.7.3 // indirect
17
- golang.org/x/sys v0.23 .0 // indirect
17
+ golang.org/x/sys v0.24 .0 // indirect
18
18
golang.org/x/text v0.17.0 // indirect
19
19
)
Original file line number Diff line number Diff line change @@ -8,8 +8,8 @@ github.com/ncruces/julianday v1.0.0 h1:fH0OKwa7NWvniGQtxdJRxAgkBMolni2BjDHaWTxqt
8
8
github.com/ncruces/julianday v1.0.0 /go.mod h1:Dusn2KvZrrovOMJuOt0TNXL6tB7U2E8kvza5fFc9G7g =
9
9
github.com/tetratelabs/wazero v1.7.3 h1:PBH5KVahrt3S2AHgEjKu4u+LlDbbk+nsGE3KLucy6Rw =
10
10
github.com/tetratelabs/wazero v1.7.3 /go.mod h1:ytl6Zuh20R/eROuyDaGPkp82O9C/DJfXAwJfQ3X6/7Y =
11
- golang.org/x/sys v0.23 .0 h1:YfKFowiIMvtgl1UERQoTPPToxltDeZfbj4H7dVUCwmM =
12
- golang.org/x/sys v0.23 .0 /go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA =
11
+ golang.org/x/sys v0.24 .0 h1:Twjiwq9dn6R1fQcyiK+wQyHWfaz/BJB+YIpzU/Cv3Xg =
12
+ golang.org/x/sys v0.24 .0 /go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA =
13
13
golang.org/x/text v0.17.0 h1:XtiM5bkSOt+ewxlOE/aE/AKEHibwj/6gvWMl9Rsh0Qc =
14
14
golang.org/x/text v0.17.0 /go.mod h1:BuEKDfySbSR4drPmRPG/7iBdf8hvFMuRexcpahXilzY =
15
15
gorm.io/gorm v1.25.11 h1:/Wfyg1B/je1hnDx3sMkX+gAlxrlZpn6X0BXRlwXlvHg =
Original file line number Diff line number Diff line change @@ -7,6 +7,8 @@ ROOT=../../../
7
7
BINARYEN=" $ROOT /tools/binaryen/bin"
8
8
WASI_SDK=" $ROOT /tools/wasi-sdk/bin"
9
9
10
+ trap ' rm -f sql3parse_table.tmp' EXIT
11
+
10
12
" $WASI_SDK /clang" --target=wasm32-wasi -std=c23 -g0 -Oz \
11
13
-Wall -Wextra -o sql3parse_table.wasm main.c \
12
14
-mexec-model=reactor \
@@ -18,7 +20,6 @@ WASI_SDK="$ROOT/tools/wasi-sdk/bin"
18
20
-Wl,--import-undefined \
19
21
-Wl,--export=sql3parse_table
20
22
21
- trap ' rm -f sql3parse_table.tmp' EXIT
22
23
" $BINARYEN /wasm-ctor-eval" -c _initialize sql3parse_table.wasm -o sql3parse_table.tmp
23
24
" $BINARYEN /wasm-opt" --strip --strip-debug --strip-producers -c -Oz \
24
25
sql3parse_table.tmp -o sql3parse_table.wasm \
You can’t perform that action at this time.
0 commit comments