feat(server): cleanup legacy compatibility (#15239)

This commit is contained in:
DarkSky
2026-07-15 03:01:51 +08:00
committed by GitHub
parent 00d4ab10a1
commit e145d87d56
104 changed files with 3184 additions and 8883 deletions
@@ -188,10 +188,7 @@ export class IndexerResolver {
docIdColumn: Prisma.raw('candidate_docs.doc_id'),
} as const;
const predicate = this.permission.docReadableSqlPredicate(input);
const fallbackPredicate =
this.permission.fallbackDocReadableSqlPredicate(input);
const query = (predicate: Prisma.Sql) =>
this.db.$queryRaw<{ docId: string }[]>`
const rows = await this.db.$queryRaw<{ docId: string }[]>`
WITH candidate_docs AS (
SELECT "workspace_pages"."page_id" AS doc_id
FROM "workspace_pages"
@@ -205,12 +202,6 @@ export class IndexerResolver {
FROM candidate_docs
WHERE ${predicate}
`;
const rows = await query(predicate).catch(error => {
if (!fallbackPredicate) {
throw error;
}
return query(fallbackPredicate);
});
return rows.map(row => row.docId);
}
}