refactor(cli): use dialect display parsing for entity details

This commit is contained in:
Andrey Avtomonov 2026-05-25 00:30:40 +02:00
parent f000221f78
commit 70a59c8c01
2 changed files with 30 additions and 49 deletions

View file

@ -201,6 +201,22 @@ describe('createKtxEntityDetailsService', () => {
});
});
it('resolves quoted qualified display strings through the dialect parser', async () => {
await seedScan({ syncId: 'sync-1', runId: 'scan-1' });
const service = createKtxEntityDetailsService(project);
const result = await service.read({
connectionId: 'warehouse',
entities: [{ table: '"public"."orders"' }],
});
expect(result.results[0]).toMatchObject({
ok: true,
display: 'public.orders',
tableRef: { catalog: null, db: 'public', name: 'orders' },
});
});
it('filters requested columns while keeping full-table foreign keys', async () => {
await seedScan({ syncId: 'sync-1', runId: 'scan-1' });
const service = createKtxEntityDetailsService(project);