/** * @copyright Cube Dev, Inc. * @license Apache-2.0 * @fileoverview The `RedshiftDriver` and related types declaration. */ import { PostgresDriver, PostgresDriverConfiguration, type PgQueryResult, PgClient, PgClientConfig } from '@cubejs-backend/postgres-driver'; import { DatabaseStructure, DownloadTableCSVData, DriverCapabilities, QueryColumnsResult, QuerySchemasResult, QueryTablesResult, StreamOptions, StreamTableDataWithTypes, TableColumn, TableStructure, UnloadOptions } from '@cubejs-backend/base-driver'; interface RedshiftDriverExportRequiredAWS { bucketType: 's3'; bucketName: string; region: string; } interface RedshiftDriverExportArnAWS extends RedshiftDriverExportRequiredAWS { unloadArn?: string; } interface RedshiftDriverExportKeySecretAWS extends RedshiftDriverExportRequiredAWS { keyId?: string; secretKey?: string; } interface RedshiftDriverExportAWS extends RedshiftDriverExportArnAWS, RedshiftDriverExportKeySecretAWS { } export interface RedshiftDriverConfiguration extends PostgresDriverConfiguration { exportBucket?: RedshiftDriverExportAWS; } /** * Redshift driver class. */ export declare class RedshiftDriver extends PostgresDriver { private readonly credentials; /** * Returns default concurrency value. */ static getDefaultConcurrency(): number; /** * Class constructor. */ constructor(config?: RedshiftDriverConfiguration & { /** * Data source name. */ dataSource?: string; /** * Whether this driver is used for pre-aggregations. */ preAggregations?: boolean; /** * Max pool size value for the [cube]<-->[db] pool. */ maxPoolSize?: number; /** * Time to wait for a response from a connection after validation * request before determining it as not valid. Default - 10000 ms. */ testConnectionTimeout?: number; }); protected createConnection(poolConfig: PgClientConfig, poolName: string): Promise; protected primaryKeysQuery(): null; protected foreignKeysQuery(): null; /** * @override */ protected informationSchemaQuery(): string; /** * In Redshift schemas not owned by the current user are not shown in regular information_schema, * so it needs to be queried through the pg_namespace table. Because user might be granted specific * permissions on the concrete schema (like CREATE tables in already existing but not owned pre-aggregation schema). * @override */ createSchemaIfNotExists(schemaName: string): Promise; /** * In Redshift external tables are not shown in regular Postgres information_schema, * so it needs to be queried separately. * @override */ tablesSchema(): Promise; private tablesForExternalSchema; private columnsForExternalTable; /** * @override */ protected getSchemasQuery(): string; /** * From the Redshift docs: * SHOW SCHEMAS FROM DATABASE database_name [LIKE 'filter_pattern'] [LIMIT row_limit ] * It returns regular schemas (queryable from information_schema) and external ones. * @override */ getSchemas(): Promise; getTablesForSpecificSchemas(schemas: QuerySchemasResult[]): Promise; getColumnsForSpecificTables(tables: QueryTablesResult[]): Promise; /** * @override */ protected getInitialConfiguration(dataSource: string, preAggregations?: boolean): Partial; protected static checkValuesLimit(values?: unknown[]): void; createTable(quotedTableName: string, columns: TableColumn[]): Promise; /** * AWS Redshift doesn't have any special connection check. * And querying even system tables is billed. * @override */ testConnection(): Promise; stream(query: string, values: unknown[], options: StreamOptions): Promise; protected queryResponse(query: string, values: unknown[]): Promise>; protected getExportBucket(dataSource: string, preAggregations?: boolean): RedshiftDriverExportAWS | undefined; loadUserDefinedTypes(): Promise; tableColumnTypes(table: string): Promise; isUnloadSupported(): Promise; unload(tableName: string, options: UnloadOptions): Promise; capabilities(): DriverCapabilities; } export {}; //# sourceMappingURL=RedshiftDriver.d.ts.map