Common interface for 7 warehouse types.
enum WarehouseTypes {
BIGQUERY = 'bigquery',
POSTGRES = 'postgres',
REDSHIFT = 'redshift',
SNOWFLAKE = 'snowflake',
DATABRICKS = 'databricks',
TRINO = 'trino',
CLICKHOUSE = 'clickhouse'
}interface WarehouseClient {
credentials: WarehouseCredentials;
test(): Promise<void>;
getCatalog(config: WarehouseCatalog): Promise<WarehouseCatalog>;
streamQuery(sql: string, streamCallback: (data: WarehouseResults) => void, options?: any): Promise<void>;
runQuery(sql: string, tags?: RunQueryTags, options?: any): Promise<WarehouseResults>;
}
interface WarehouseResults {
fields: Record<string, { type: DimensionType }>;
rows: Record<string, unknown>[];
}type WarehouseCredentials =
| BigQueryCredentials
| PostgresCredentials
| RedshiftCredentials
| SnowflakeCredentials
| DatabricksCredentials
| TrinoCredentials
| ClickHouseCredentials;
interface SshTunnelConfiguration {
enabled: boolean;
host?: string;
port?: number;
username?: string;
publicKey?: string;
}
interface SslConfiguration {
enabled: boolean;
ca?: string;
cert?: string;
key?: string;
}
function mergeWarehouseCredentials(
target: WarehouseCredentials,
update: Partial<CreateWarehouseCredentials>
): CreateWarehouseCredentials;