mirror of https://github.com/sysown/proxysql
This commit integrates sqlite-vec (https://github.com/asg017/sqlite-vec) as a statically linked extension, enabling vector search capabilities in all ProxySQL SQLite databases (admin, stats, config, monitor). Changes: 1. Added sqlite-vec source files to deps/sqlite3/sqlite-vec-source/ - sqlite-vec.c: main extension source - sqlite-vec.h: header for static linking - sqlite-vec.h.tmpl: template header 2. Modified deps/Makefile: - Added target sqlite3/sqlite3/vec.o that copies sources and compiles with flags -DSQLITE_CORE -DSQLITE_VEC_STATIC - Made sqlite3 target depend on vec.o 3. Modified lib/Makefile: - Added $(SQLITE3_LDIR)/vec.o to libproxysql.a prerequisites - Included vec.o in the static library archive 4. Modified lib/Admin_Bootstrap.cpp: - Added extern "C" declaration for sqlite3_vec_init - Enabled load extension support for all databases: - admindb, statsdb, configdb, monitordb, statsdb_disk - Registered sqlite3_vec_init as auto-extension at database open (replacing commented sqlite3_json_init) 5. Updated top-level Makefile: - Made GIT_VERSION fallback to git describe --always when tags missing Result: - Vector search functions (vec0 virtual tables, vector operations) are available in all ProxySQL SQLite databases without runtime dependencies - No separate shared library required; fully embedded in proxysql binary - Extension automatically loaded at database initializationpull/5310/head
parent
faa64a570d
commit
fbd0d9732b
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,39 @@
|
||||
#ifndef SQLITE_VEC_H
|
||||
#define SQLITE_VEC_H
|
||||
|
||||
#ifndef SQLITE_CORE
|
||||
#include "sqlite3ext.h"
|
||||
#else
|
||||
#include "sqlite3.h"
|
||||
#endif
|
||||
|
||||
#ifdef SQLITE_VEC_STATIC
|
||||
#define SQLITE_VEC_API
|
||||
#else
|
||||
#ifdef _WIN32
|
||||
#define SQLITE_VEC_API __declspec(dllexport)
|
||||
#else
|
||||
#define SQLITE_VEC_API
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#define SQLITE_VEC_VERSION "v0.1.0"
|
||||
#define SQLITE_VEC_DATE "2025-12-22"
|
||||
#define SQLITE_VEC_SOURCE "sqlite-vec.c"
|
||||
|
||||
#define SQLITE_VEC_VERSION_MAJOR 0
|
||||
#define SQLITE_VEC_VERSION_MINOR 1
|
||||
#define SQLITE_VEC_VERSION_PATCH 0
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
SQLITE_VEC_API int sqlite3_vec_init(sqlite3 *db, char **pzErrMsg,
|
||||
const sqlite3_api_routines *pApi);
|
||||
|
||||
#ifdef __cplusplus
|
||||
} /* end of the 'extern "C"' block */
|
||||
#endif
|
||||
|
||||
#endif /* ifndef SQLITE_VEC_H */
|
||||
@ -0,0 +1,41 @@
|
||||
#ifndef SQLITE_VEC_H
|
||||
#define SQLITE_VEC_H
|
||||
|
||||
#ifndef SQLITE_CORE
|
||||
#include "sqlite3ext.h"
|
||||
#else
|
||||
#include "sqlite3.h"
|
||||
#endif
|
||||
|
||||
#ifdef SQLITE_VEC_STATIC
|
||||
#define SQLITE_VEC_API
|
||||
#else
|
||||
#ifdef _WIN32
|
||||
#define SQLITE_VEC_API __declspec(dllexport)
|
||||
#else
|
||||
#define SQLITE_VEC_API
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#define SQLITE_VEC_VERSION "v${VERSION}"
|
||||
// TODO rm
|
||||
#define SQLITE_VEC_DATE "${DATE}"
|
||||
#define SQLITE_VEC_SOURCE "${SOURCE}"
|
||||
|
||||
|
||||
#define SQLITE_VEC_VERSION_MAJOR ${VERSION_MAJOR}
|
||||
#define SQLITE_VEC_VERSION_MINOR ${VERSION_MINOR}
|
||||
#define SQLITE_VEC_VERSION_PATCH ${VERSION_PATCH}
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
SQLITE_VEC_API int sqlite3_vec_init(sqlite3 *db, char **pzErrMsg,
|
||||
const sqlite3_api_routines *pApi);
|
||||
|
||||
#ifdef __cplusplus
|
||||
} /* end of the 'extern "C"' block */
|
||||
#endif
|
||||
|
||||
#endif /* ifndef SQLITE_VEC_H */
|
||||
Loading…
Reference in new issue