mirror of
https://github.com/Kaelio/ktx.git
synced 2026-06-28 08:49:38 +02:00
feat(cli): redesign database scope picker for searchable schema-first setup (#203)
* feat: add searchable setup prompt pickers * fix: make snowflake scope discovery single query * fix: make bigquery table discovery schema scoped * fix: honor mysql and clickhouse database scope * feat: wire schema scope discovery for all relational setup drivers * feat: add schema-first database scope picker * test: update setup prompt stubs for type-check * docs: document database scope picker fields * Fix database setup edit preservation --------- Co-authored-by: Andrey Avtomonov <7889985+andreybavt@users.noreply.github.com>
This commit is contained in:
parent
fd2ba62d92
commit
c87d14a554
30 changed files with 1530 additions and 331 deletions
|
|
@ -0,0 +1,19 @@
|
|||
import { describe, expect, it } from 'vitest';
|
||||
import { normalizeBigQueryProjectId, normalizeBigQueryRegion } from './bigquery-identifiers.js';
|
||||
|
||||
describe('BigQuery identifier normalization', () => {
|
||||
it('normalizes project ids and regions for information schema paths', () => {
|
||||
expect(normalizeBigQueryProjectId('project-1')).toBe('project-1');
|
||||
expect(normalizeBigQueryRegion('US')).toBe('us');
|
||||
expect(normalizeBigQueryRegion('region-eu')).toBe('eu');
|
||||
});
|
||||
|
||||
it('rejects malformed project ids and regions with caller-specific context', () => {
|
||||
expect(() => normalizeBigQueryProjectId('project`1', 'table discovery')).toThrow(
|
||||
'Invalid BigQuery project id for table discovery: project`1',
|
||||
);
|
||||
expect(() => normalizeBigQueryRegion('US;DROP', 'table discovery')).toThrow(
|
||||
'Invalid BigQuery region for table discovery: US;DROP',
|
||||
);
|
||||
});
|
||||
});
|
||||
Loading…
Add table
Add a link
Reference in a new issue