A lightweight, customized Vector Database built in C++ utilizing SQLite as the underlying storage engine.
Before setting up the project, ensure you have the following installed on your system:
- GCC/G++ Compiler: Part of MinGW-w64 (Windows) or Clang (macOS) to compile C++17 or higher.
- VS Code: Recommended IDE with the C/C++ extension installed.
To keep the repository lightweight, the SQLite source files are not included in this repository. You must download them manually:
- Visit the SQLite Download Page.
- Look for the Source Code section and download the sqlite-amalgamation-*.zip file.
- Extract the ZIP file. You will see files named
sqlite3.c,sqlite3.h, andsqlite3ext.h. - Copy these files into your local project directory structure like this:
- Move
sqlite3.hinto theinclude/folder. - Place the remaining files (
sqlite3.c,shell.c) into a folder namedsqlite-amalgamation-3530100/in the project root.
- Move
Your project directory should look like this after the manual setup:
vector-db/
├── .vscode/ # Build and launch configurations
├── data/ # Database storage and mock vectors
│ └── database.txt
├── include/ # Header files
│ ├── record.h
│ ├── vectordb.h
│ └── sqlite3.h <-- Manually Added
├── src/ # Main source code
│ └── main.cpp
├── sqlite-amalgamation-3530100/
│ ├── sqlite3.c <-- Manually Added
│ └── shell.c <-- Manually Added
└── .gitignore
- Open the
vector-dbfolder in VS Code. - Press
Ctrl + Shift + B(Windows) orCmd + Shift + B(macOS) to run the compilation task configured in.vscode/tasks.json. - Press
F5to run and debug the application.
If you prefer to compile manually via the command line, navigate to the project root and run:
g++ -std=c++17 src/main.cpp sqlite-amalgamation-3530100/sqlite3.c -I ./include -o main.exe
./main.exe