The current implementation either needs two separate SQLite3 DBs (which is inefficient) or will open the same DB twice from different classes (which might lead to blocking each, inefficient and dangerous).
To solve this, add a "DatabaseProvider" interface to Index so that the enclosing class can provide a single open DB to both instances of KeywordIndex and VectorIndex.
The current implementation either needs two separate SQLite3 DBs (which is inefficient) or will open the same DB twice from different classes (which might lead to blocking each, inefficient and dangerous).
To solve this, add a "
DatabaseProvider" interface toIndexso that the enclosing class can provide a single open DB to both instances ofKeywordIndexandVectorIndex.