| 727 | } |
| 728 | |
| 729 | private async batchResolveAliases(rids: string[]): Promise<Map<string, string>> { |
| 730 | if (rids.length === 0) return new Map(); |
| 731 | |
| 732 | const result = await query<{ alias_rid: string; canonical_rid: string }>( |
| 733 | `SELECT alias_rid, canonical_rid FROM catalog_aliases WHERE alias_rid = ANY($1)`, |
| 734 | [rids] |
| 735 | ); |
| 736 | |
| 737 | const map = new Map<string, string>(); |
| 738 | for (const row of result.rows) { |
| 739 | map.set(row.alias_rid, row.canonical_rid); |
| 740 | } |
| 741 | return map; |
| 742 | } |
| 743 | |
| 744 | /** |
| 745 | * Batch classification lookup — single query for all identifiers. |