feat(cli): extend ktx connection test to every supported driver

Dispatch by driver: native DBs now call `connector.testConnection()`
(was `introspect(dryRun)`), looker/notion/metabase hit their auth
endpoints, and dbt/metricflow/lookml run `git ls-remote` via the
existing `testRepoConnection` helper. Unknown drivers exit 1 with a
listing of supported ones.
This commit is contained in:
Andrey Avtomonov 2026-05-14 15:37:09 +02:00
parent 52dd89481c
commit 7ee9949cf5
7 changed files with 489 additions and 115 deletions

View file

@ -370,6 +370,7 @@ export type {
KtxQueryResult,
KtxReadOnlyQueryInput,
KtxResolvedCredentialEnvelope,
KtxConnectorTestResult,
KtxScanArtifactPaths,
KtxScanConnector,
KtxScanContext,

View file

@ -283,12 +283,18 @@ export interface KtxTableListEntry {
kind: 'table' | 'view';
}
export interface KtxConnectorTestResult {
success: boolean;
error?: string;
}
export interface KtxScanConnector {
id: string;
driver: KtxConnectionDriver;
capabilities: KtxConnectorCapabilities;
eventStreamDiscovery?: KtxEventStreamDiscoveryPort;
introspect(input: KtxScanInput, ctx: KtxScanContext): Promise<KtxSchemaSnapshot>;
testConnection?(): Promise<KtxConnectorTestResult>;
sampleColumn?(input: KtxColumnSampleInput, ctx: KtxScanContext): Promise<KtxColumnSampleResult>;
sampleTable?(input: KtxTableSampleInput, ctx: KtxScanContext): Promise<KtxTableSampleResult>;
columnStats?(input: KtxColumnStatsInput, ctx: KtxScanContext): Promise<KtxColumnStatsResult | null>;