deps/sqlite3/sqlite-vec-source/README.md
This directory contains the source files for sqlite-vec, an SQLite extension that provides vector search capabilities directly within SQLite databases.
sqlite-vec is an open-source SQLite extension that enables SQLite to perform vector similarity searches. It implements vector search as a SQLite virtual table, providing:
-- Create a vector table
CREATE VIRTUAL TABLE my_vectors USING vec0(
vector float[128]
);
-- Insert vectors
INSERT INTO my_vectors(rowid, vector)
VALUES (1, json('[0.1, 0.2, 0.3, ..., 0.128]'));
-- Search for similar vectors
SELECT rowid, distance
FROM my_vectors
WHERE vector MATCH json('[0.1, 0.2, 0.3, ..., 0.128]')
LIMIT 10;
The main implementation file containing:
Header file with:
Template for generating the header file.
These source files are integrated into ProxySQL through static linking:
In ProxySQL's build system, sqlite-vec is compiled with these flags:
-DSQLITE_CORE - Compile as part of SQLite core-DSQLITE_VEC_STATIC - Enable static linking mode-DSQLITE_ENABLE_MEMORY_MANAGEMENT - Memory management features-DSQLITE_ENABLE_JSON1 - JSON support-DSQLITE_DLL=1 - DLL compatibilitylibproxysql.asqlite-vec is licensed under the MIT License. Please refer to the original project for complete license information.
For complete documentation, examples, and API reference, see:
To build sqlite-vec standalone (outside of ProxySQL):
# Download source
git clone https://github.com/asg017/sqlite-vec.git
cd sqlite-vec
# Build the extension
gcc -shared -fPIC -o libsqlite_vec.so sqlite_vec.c -I/path/to/sqlite/include \
-DSQLITE_VEC_STATIC -DSQLITE_ENABLE_JSON1
This is a third-party library integrated into ProxySQL. For bugs, features, or contributions: