-
Notifications
You must be signed in to change notification settings - Fork 166
/
Copy pathgo-sqlite3.patch
31 lines (29 loc) · 1.03 KB
/
go-sqlite3.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
diff --git a/embed/build.sh b/embed/build.sh
index ed2aaec..4cc0b0e 100755
--- a/embed/build.sh
+++ b/embed/build.sh
@@ -23,6 +23,7 @@ trap 'rm -f sqlite3.tmp' EXIT
-Wl,--initial-memory=327680 \
-D_HAVE_SQLITE_CONFIG_H \
-DSQLITE_CUSTOM_INCLUDE=sqlite_opt.h \
+ -DSQLITE_VEC_OMIT_FS=1 \
$(awk '{print "-Wl,--export="$0}' exports.txt)
"$BINARYEN/wasm-ctor-eval" -g -c _initialize sqlite3.wasm -o sqlite3.tmp
diff --git a/sqlite3/main.c b/sqlite3/main.c
index c732937..7c9002a 100644
--- a/sqlite3/main.c
+++ b/sqlite3/main.c
@@ -19,6 +19,7 @@
#include "time.c"
#include "vfs.c"
#include "vtab.c"
+#include "../../sqlite-vec.c"
__attribute__((constructor)) void init() {
sqlite3_initialize();
@@ -30,4 +31,5 @@ __attribute__((constructor)) void init() {
sqlite3_auto_extension((void (*)(void))sqlite3_spellfix_init);
sqlite3_auto_extension((void (*)(void))sqlite3_uint_init);
sqlite3_auto_extension((void (*)(void))sqlite3_time_init);
+ sqlite3_auto_extension((void (*)(void))sqlite3_vec_init);
}
\ No newline at end of file