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

33 lines
1 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-07-11 22:58:23 -07:00
index 014bd22..f9ccc7d 100755
2024-07-11 22:36:18 -07:00
--- a/embed/build.sh
+++ b/embed/build.sh
2024-07-11 22:58:23 -07:00
@@ -21,6 +21,7 @@ WASI_SDK="$ROOT/tools/wasi-sdk-23.0/bin"
-Wl,--initial-memory=327680 \
2024-07-11 22:36:18 -07:00
-D_HAVE_SQLITE_CONFIG_H \
-DSQLITE_CUSTOM_INCLUDE=sqlite_opt.h \
2024-07-11 22:58:23 -07:00
+ -DSQLITE_VEC_OMIT_FS=1 \
2024-07-11 22:36:18 -07:00
$(awk '{print "-Wl,--export="$0}' exports.txt)
2024-07-11 22:58:23 -07:00
trap 'rm -f sqlite3.tmp' EXIT
2024-07-11 22:36:18 -07:00
diff --git a/sqlite3/main.c b/sqlite3/main.c
2024-07-11 22:58:23 -07:00
index 4fb926b..4cade42 100644
2024-07-11 22:36:18 -07:00
--- a/sqlite3/main.c
+++ b/sqlite3/main.c
@@ -16,7 +16,7 @@
#include "time.c"
#include "vfs.c"
#include "vtab.c"
-
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-07-11 22:58:23 -07:00
2024-07-11 22:36:18 -07:00
__attribute__((constructor)) void init() {
@@ -28,4 +28,5 @@ __attribute__((constructor)) void init() {
sqlite3_auto_extension((void (*)(void))sqlite3_series_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