Much better structure. Among some of the things I have done are;
Created SqlStatement class encapsulating all SQL statements executed towards SQLite
Moved things into relevant "xyz.h" file to separate concerns, making the code more readable
Applied better encapsulation and cohesion, in particular by expanding upon the vss_index class, moving parts it should be responsible for into it as methods
Data hiding by making the original structs into "real classes" with private and public members and methods
More work needs to be done, especially on the "xyz.h" files, that really should have associated "xyz.cpp" files, but at least it's a start. I tried to implement memory cache on the faiss indexes, and I had everything working, but didn't understand why the cache mechanism didn't work, until I realised SQLite will dynamically load the library on every connection, resulting in that my static std::map would be deleted, and hence my approach to caching was useless. I removed these parts, but you can see the idea in the history if interested.
Psst, you'll have to check out the branch in its entirety. There's no way you can make sense of the pull request by looking at the diff.
Much better structure. Among some of the things I have done are;
SqlStatement
class encapsulating all SQL statements executed towards SQLitevss_index
class, moving parts it should be responsible for into it as methodsMore work needs to be done, especially on the "xyz.h" files, that really should have associated "xyz.cpp" files, but at least it's a start. I tried to implement memory cache on the faiss indexes, and I had everything working, but didn't understand why the cache mechanism didn't work, until I realised SQLite will dynamically load the library on every connection, resulting in that my static
std::map
would be deleted, and hence my approach to caching was useless. I removed these parts, but you can see the idea in the history if interested.Psst, you'll have to check out the branch in its entirety. There's no way you can make sense of the pull request by looking at the diff.