From b565f24c6e074edd60b414544499e454641be1cd Mon Sep 17 00:00:00 2001 From: Laurent Date: Thu, 29 Oct 2026 18:44:16 +0100 Subject: [PATCH 1/2] Keep sqlite3ext.h and sqlite-vec.h out of the public CSQLiteVec module The bundled sqlite3ext.h defines sqlite3_api_routines for the bundled SQLite. When an app also imports the SDK's SQLite3 module, whose sqlite3ext.h comes from a different SQLite version, Clang rejects the two definitions of the struct ("has different definitions in different modules"). Xcode 27.1 ships SQLite 3.54.0 against the bundled 3.51.0, so any target importing both fails. The Swift wrapper only needs extinit.h, and sqlite-vec.c and extinit.c include these headers with quotes, so they now sit next to the sources instead of in include/. deps.sh copies them there too. Co-Authored-By: Claude --- Sources/CSQLiteVec/{include => }/sqlite-vec.h | 0 Sources/CSQLiteVec/{include => }/sqlite3ext.h | 0 deps.sh | 4 ++-- 3 files changed, 2 insertions(+), 2 deletions(-) rename Sources/CSQLiteVec/{include => }/sqlite-vec.h (100%) rename Sources/CSQLiteVec/{include => }/sqlite3ext.h (100%) diff --git a/Sources/CSQLiteVec/include/sqlite-vec.h b/Sources/CSQLiteVec/sqlite-vec.h similarity index 100% rename from Sources/CSQLiteVec/include/sqlite-vec.h rename to Sources/CSQLiteVec/sqlite-vec.h diff --git a/Sources/CSQLiteVec/include/sqlite3ext.h b/Sources/CSQLiteVec/sqlite3ext.h similarity index 100% rename from Sources/CSQLiteVec/include/sqlite3ext.h rename to Sources/CSQLiteVec/sqlite3ext.h diff --git a/deps.sh b/deps.sh index 2c879ed..1ff233b 100755 --- a/deps.sh +++ b/deps.sh @@ -12,7 +12,7 @@ unzip -q sqlite-amalgamation.zip SQLITE_DIR=$(unzip -l sqlite-amalgamation.zip | grep -m1 "sqlite-amalgamation-" | awk '{print $4}' | cut -d/ -f1) cp ${SQLITE_DIR}/sqlite3.c Sources/CSQLiteVec/ cp ${SQLITE_DIR}/sqlite3.h Sources/CSQLiteVec/include/ -cp ${SQLITE_DIR}/sqlite3ext.h Sources/CSQLiteVec/include/ +cp ${SQLITE_DIR}/sqlite3ext.h Sources/CSQLiteVec/ rm -rf ${SQLITE_DIR} rm sqlite-amalgamation.zip @@ -21,5 +21,5 @@ rm sqlite-amalgamation.zip curl -o sqlite-vec-amalgamation.zip -L https://github.com/asg017/sqlite-vec/releases/download/v${SQLITE_VEC_VERSION}/sqlite-vec-${SQLITE_VEC_VERSION}-amalgamation.zip unzip -q sqlite-vec-amalgamation.zip mv sqlite-vec.c Sources/CSQLiteVec/ -mv sqlite-vec.h Sources/CSQLiteVec/include/ +mv sqlite-vec.h Sources/CSQLiteVec/ rm sqlite-vec-amalgamation.zip From b75d9f12f95bb94d82136187fcacb585679319bc Mon Sep 17 00:00:00 2001 From: Laurent Date: Thu, 5 Nov 2026 18:35:53 +0100 Subject: [PATCH 2/2] Expose sqlite3_vec_init in the public CSQLiteVec module Declare sqlite3_vec_init in extinit.h so it stays part of the public API now that sqlite-vec.h is private. sqlite3.h forward-declares sqlite3_api_routines, so sqlite3ext.h stays out of the public module. Co-Authored-By: Claude Opus 5.5 --- Sources/CSQLiteVec/include/extinit.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Sources/CSQLiteVec/include/extinit.h b/Sources/CSQLiteVec/include/extinit.h index b8d4ad0..853d14f 100644 --- a/Sources/CSQLiteVec/include/extinit.h +++ b/Sources/CSQLiteVec/include/extinit.h @@ -10,6 +10,12 @@ extern "C" { int core_vec_init(); +int sqlite3_vec_init( + sqlite3 *db, + char **pzErrMsg, + const sqlite3_api_routines *pApi +); + #ifdef __cplusplus } /* end of the 'extern "C"' block */ #endif