mirror of
https://github.com/Kaelio/ktx.git
synced 2026-06-13 08:15:14 +02:00
fix(cli): carry catalog through the picker so BigQuery/Snowflake/SQL Server scope filters match
The setup picker's KtxTableListEntry was a 2-level { schema, name }, so
qualifiedTableId always wrote db.name into enabled_tables. When BigQuery,
Snowflake, or SQL Server later ran fast ingest, their introspect step filtered
the scope set with scopedTableNames(scope, { catalog: projectId|database, db })
— catalog was non-null on the introspect side but null in the scope refs, so
every entry was rejected, the live-database adapter staged zero table files,
and detect() failed with 'Adapter "live-database" did not recognize fetched
source output'.
Align the picker boundary with the canonical 3-level KtxTableRef:
- Add catalog: string | null to KtxTableListEntry.
- BigQuery/Snowflake/SQL Server listTables populate catalog from the
resolved projectId / database; Postgres/MySQL/ClickHouse/SQLite set null.
- qualifiedTableId emits catalog.schema.name when catalog is non-null
(resolveEnabledTables already accepts the 3-part shape) and
schemasFromEnabledTables now goes through parseDottedTableEntry so it
recovers the schema correctly from both 2-part and 3-part entries.
- Export parseDottedTableEntry from enabled-tables.ts (@internal) for picker
reuse.
Update listTables expectations in all seven connector tests and the setup /
picker test fixtures. Add a picker regression test that covers the
catalog-bearing round-trip (save + refine).
This commit is contained in:
parent
c526601d52
commit
cbe6a5f4b3
19 changed files with 193 additions and 51 deletions
|
|
@ -390,9 +390,9 @@ describe('KtxSqlServerScanConnector', () => {
|
|||
await expect(connector.getTableRowCount('orders')).resolves.toBe(2);
|
||||
await expect(connector.listSchemas()).resolves.toEqual(['dbo', 'sales']);
|
||||
await expect(connector.listTables(['dbo'])).resolves.toEqual([
|
||||
{ schema: 'dbo', name: 'customers', kind: 'table' },
|
||||
{ schema: 'dbo', name: 'order_summary', kind: 'view' },
|
||||
{ schema: 'dbo', name: 'orders', kind: 'table' },
|
||||
{ catalog: 'analytics', schema: 'dbo', name: 'customers', kind: 'table' },
|
||||
{ catalog: 'analytics', schema: 'dbo', name: 'order_summary', kind: 'view' },
|
||||
{ catalog: 'analytics', schema: 'dbo', name: 'orders', kind: 'table' },
|
||||
]);
|
||||
await expect(
|
||||
connector.columnStats(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue