sqlite-vec/bindings/go/ncruces/go-sqlite3.patch

40 lines
1.4 KiB
Diff
Raw Normal View History

2024-07-11 22:36:18 -07:00
diff --git a/embed/build.sh b/embed/build.sh
2024-08-09 11:00:02 -07:00
index 6141efd..b4f0ebe 100755
2024-07-11 22:36:18 -07:00
--- a/embed/build.sh
+++ b/embed/build.sh
2024-08-09 11:00:02 -07:00
@@ -23,6 +23,7 @@ trap 'rm -f sqlite3.tmp' EXIT
2024-07-11 22:58:23 -07:00
-Wl,--initial-memory=327680 \
2024-07-11 22:36:18 -07:00
-D_HAVE_SQLITE_CONFIG_H \
-DSQLITE_CUSTOM_INCLUDE=sqlite_opt.h \
2024-08-09 11:00:02 -07:00
+ -DSQLITE_VEC_OMIT_FS=1 \
2024-07-11 22:36:18 -07:00
$(awk '{print "-Wl,--export="$0}' exports.txt)
2024-08-09 11:00:02 -07:00
"$BINARYEN/wasm-ctor-eval" -g -c _initialize sqlite3.wasm -o sqlite3.tmp
@@ -30,4 +31,4 @@ trap 'rm -f sqlite3.tmp' EXIT
sqlite3.tmp -o sqlite3.wasm \
--enable-simd --enable-mutable-globals --enable-multivalue \
--enable-bulk-memory --enable-reference-types \
- --enable-nontrapping-float-to-int --enable-sign-ext
\ No newline at end of file
+ --enable-nontrapping-float-to-int --enable-sign-ext
2024-07-11 22:36:18 -07:00
diff --git a/sqlite3/main.c b/sqlite3/main.c
2024-08-09 11:00:02 -07:00
index 4fb926b..869d38b 100644
2024-07-11 22:36:18 -07:00
--- a/sqlite3/main.c
+++ b/sqlite3/main.c
2024-08-09 11:00:02 -07:00
@@ -17,6 +17,7 @@
2024-07-11 22:36:18 -07:00
#include "vfs.c"
#include "vtab.c"
2024-08-09 11:00:02 -07:00
2024-07-11 22:45:27 -07:00
+#include "../../sqlite-vec.c"
2024-07-11 22:36:18 -07:00
sqlite3_destructor_type malloc_destructor = &free;
2024-08-09 11:00:02 -07:00
2024-07-11 22:36:18 -07:00
__attribute__((constructor)) void init() {
2024-08-09 11:00:02 -07:00
@@ -28,4 +29,5 @@ __attribute__((constructor)) void init() {
2024-07-11 22:36:18 -07:00
sqlite3_auto_extension((void (*)(void))sqlite3_series_init);
sqlite3_auto_extension((void (*)(void))sqlite3_uint_init);
sqlite3_auto_extension((void (*)(void))sqlite3_time_init);
2024-08-09 11:00:02 -07:00
-}
2024-07-11 22:36:18 -07:00
\ No newline at end of file
2024-08-09 11:00:02 -07:00
+ sqlite3_auto_extension((void (*)(void))sqlite3_vec_init);
+}