deps/sqlite3/README.md
This directory contains the integration of sqlite-vec - a SQLite extension that provides vector search capabilities directly within SQLite databases.
sqlite-vec is an extension that enables SQLite to perform vector similarity searches. It provides:
sqlite-vec-source/ - Source files for sqlite-vec (committed to repository)sqlite3/ - Build directory where sqlite-vec gets compiled during the build processThe integration uses static linking to embed sqlite-vec directly into ProxySQL:
sqlite-vec-source/ to persist across builds-DSQLITE_CORE - Compiles as part of SQLite core-DSQLITE_VEC_STATIC - Enables static linking modevec.o object file is included in libproxysql.a../Makefile - Updated to ensure git version is available during build../deps/Makefile - Added compilation target for sqlite-vec../lib/Makefile - Modified to include vec.o in libproxysql.a../lib/Admin_Bootstrap.cpp - Added extension loading and auto-registration codeThe extension is enabled in all ProxySQL SQLite databases:
Once ProxySQL is built and restarted, you can use vector search functions in any SQLite database:
-- Create a vector table
CREATE VIRTUAL TABLE my_vectors USING vec0(
vector float[128]
);
-- Insert vectors with JSON format
INSERT INTO my_vectors(rowid, vector)
VALUES (1, json('[0.1, 0.2, 0.3, ..., 0.128]'));
-- Perform similarity search
SELECT rowid, distance
FROM my_vectors
WHERE vector MATCH json('[0.1, 0.2, 0.3, ..., 0.128]')
LIMIT 10;
The sqlite-vec source is compiled with these flags:
SQLITE_CORE - Integrate with SQLite coreSQLITE_VEC_STATIC - Static linking modeSQLITE_ENABLE_MEMORY_MANAGEMENT - Memory management featuresSQLITE_ENABLE_JSON1 - JSON supportSQLITE_DLL=1 - DLL compatibilityThe integration is automatic when building ProxySQL. The sqlite-vec sources are compiled and linked as part of the normal build process.
To verify that sqlite-vec is properly integrated:
makenm src/proxysql | grep vecsqlite3_vec_init, vec0_*, vector_*, etc.