doc/vector-search-test/README.md
This directory contains test scripts for verifying ProxySQL's vector search capabilities using the sqlite-vec extension.
The testing framework is organized into four main test scripts, each covering a specific aspect of vector search functionality:
Before running the tests, ensure you have:
All scripts use the following configuration (modify in each script as needed):
PROXYSQL_HOST="127.0.0.1"
PROXYSQL_PORT="6030"
MYSQL_USER="root"
MYSQL_PASS="root"
Each test script is self-contained and executable. Run them in sequence:
./test_connectivity.sh
Tests basic connectivity to ProxySQL and database operations.
./test_vector_tables.sh
Tests creation of virtual tables using sqlite-vec extension.
./test_data_insertion.sh
Tests insertion of 128-dimensional vectors into vector tables.
./test_similarity_search.sh
Tests vector similarity search with various query patterns.
WHERE vector MATCH json(...)Each script provides:
Exit codes:
0: All tests passed1: One or more tests failedConnection Errors
Table Creation Errors
Insertion Errors
Search Errors
For detailed debugging, modify the scripts to:
set -x at the beginning for verbose output-s -N flags from mysql commands for full result setsThese scripts can be integrated into CI/CD pipelines:
#!/bin/bash
# Example CI script
set -e
echo "Running vector search tests..."
./test_connectivity.sh
./test_vector_tables.sh
./test_data_insertion.sh
./test_similarity_search.sh
echo "All tests completed successfully!"
execute_test() function for consistent testingEdit the vector arrays in:
test_data_insertion.sh for insertion teststest_similarity_search.sh for search queriesUpdate variables at the top of each script:
For issues related to:
This testing framework is designed to be comprehensive yet modular. Feel free to extend and modify based on your specific testing requirements.