use web worker to run pglite

This commit is contained in:
duanfuxiang
2025-03-19 21:01:32 +08:00
parent 76288377c3
commit 679d7142eb
25 changed files with 985 additions and 461 deletions

View File

@@ -22,7 +22,7 @@ export class VectorRepository {
return tableDefinition.name
}
async getIndexedFilePaths(embeddingModel: EmbeddingModel): Promise<string[]> {
async getAllIndexedFilePaths(embeddingModel: EmbeddingModel): Promise<string[]> {
if (!this.db) {
throw new DatabaseNotInitializedException()
}
@@ -80,7 +80,7 @@ export class VectorRepository {
if (!this.db) {
throw new DatabaseNotInitializedException()
}
const tableName = this.getTableName(embeddingModel)
const tableName = this.getTableName(embeddingModel)
await this.db.query(`DELETE FROM "${tableName}"`)
}
@@ -160,7 +160,11 @@ export class VectorRepository {
if (conditions.length > 0) {
scopeCondition = `AND (${conditions.join(' OR ')})`
}
}
}
const queryVectorLength = `SELECT count(1) FROM "${tableName}"`;
const queryVectorLengthResult = await this.db.query(queryVectorLength)
console.log('queryVectorLengthResult, ', queryVectorLengthResult)
const query = `
SELECT