MCPcopy
hub / github.com/continuedev/continue / getOrCreateSqliteDb

Method getOrCreateSqliteDb

core/indexing/docs/DocsService.ts:878–902  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

876
877 // SQLITE DB
878 private async getOrCreateSqliteDb() {
879 if (!this.sqliteDb) {
880 const db = await open({
881 filename: getDocsSqlitePath(),
882 driver: sqlite3.Database,
883 });
884
885 await db.exec("PRAGMA busy_timeout = 3000;");
886
887 // First create the table if it doesn't exist
888 await db.exec(`CREATE TABLE IF NOT EXISTS ${DocsService.sqlitebTableName} (
889 id INTEGER PRIMARY KEY AUTOINCREMENT,
890 title STRING NOT NULL,
891 startUrl STRING NOT NULL,
892 favicon STRING,
893 embeddingsProviderId STRING
894 )`);
895
896 await runSqliteMigrations(db);
897
898 this.sqliteDb = db;
899 }
900
901 return this.sqliteDb;
902 }
903
904 async getFavicon(startUrl: string) {
905 if (!this.config.selectedModelByRole.embed) {

Callers 7

hasMetadataMethod · 0.95
listMetadataMethod · 0.95
getDetailsMethod · 0.95
getFaviconMethod · 0.95
addMetadataToSqliteMethod · 0.95

Calls 3

getDocsSqlitePathFunction · 0.90
runSqliteMigrationsFunction · 0.90
openFunction · 0.85

Tested by

no test coverage detected