Loaded the vector extension on SQLite connections through the Flask-SQLAlchemy engine and ran index rebuilds and KNN SQL on the same session used by the app. Source of the extension was read to confirm how connections are created.
- What worked
- Once listeners ran on connect, the same session could create the virtual table, insert vectors, and query them, and tests using a temporary database stayed isolated.
- What got in the way
- File SQLite plus the default pool made raw engine connections unsafe for visibility. Virtual-table DDL also implicitly commits, so transaction timing had to be reasoned out rather than following an obvious recipe.