mirror of
https://github.com/Kaelio/ktx.git
synced 2026-06-22 08:38:08 +02:00
Initial open-source release
This commit is contained in:
commit
1a42152e6f
1199 changed files with 257054 additions and 0 deletions
30
packages/context/src/sql-analysis/ports.ts
Normal file
30
packages/context/src/sql-analysis/ports.ts
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
export type SqlAnalysisDialect =
|
||||
| 'bigquery'
|
||||
| 'snowflake'
|
||||
| 'postgres'
|
||||
| 'redshift'
|
||||
| 'mysql'
|
||||
| 'sqlite'
|
||||
| 'tsql'
|
||||
| 'clickhouse'
|
||||
| (string & {});
|
||||
|
||||
export type SqlAnalysisLiteralSlotType = 'string' | 'number' | 'timestamp' | 'date' | 'boolean' | 'null' | 'unknown';
|
||||
|
||||
export interface SqlAnalysisLiteralSlot {
|
||||
position: number;
|
||||
type: SqlAnalysisLiteralSlotType;
|
||||
exampleValue: string;
|
||||
}
|
||||
|
||||
export interface SqlAnalysisFingerprintResult {
|
||||
fingerprint: string;
|
||||
normalizedSql: string;
|
||||
tablesTouched: string[];
|
||||
literalSlots: SqlAnalysisLiteralSlot[];
|
||||
error?: string | null;
|
||||
}
|
||||
|
||||
export interface SqlAnalysisPort {
|
||||
analyzeForFingerprint(sql: string, dialect: SqlAnalysisDialect): Promise<SqlAnalysisFingerprintResult>;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue