mirror of
https://github.com/Kaelio/ktx.git
synced 2026-06-22 08:38:08 +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('KtxPostgresScanConnector', () => {
|
|||
await expect(connector.getTableRowCount({ db: 'public', name: 'orders' })).resolves.toBe(3);
|
||||
await expect(connector.listSchemas()).resolves.toEqual(['public']);
|
||||
await expect(connector.listTables(['public'])).resolves.toEqual([
|
||||
{ schema: 'public', name: 'customers', kind: 'table' },
|
||||
{ schema: 'public', name: 'orders', kind: 'table' },
|
||||
{ schema: 'public', name: 'recent_orders', kind: 'view' },
|
||||
{ catalog: null, schema: 'public', name: 'customers', kind: 'table' },
|
||||
{ catalog: null, schema: 'public', name: 'orders', kind: 'table' },
|
||||
{ catalog: null, schema: 'public', name: 'recent_orders', kind: 'view' },
|
||||
]);
|
||||
await expect(connector.testConnection()).resolves.toEqual({ success: true });
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue