/** * @copyright Cube Dev, Inc. * @license Apache-2.0 * @fileoverview The `PrestoDriver` and related types declaration. */ import { DownloadQueryResultsOptions, DownloadQueryResultsResult, DriverCapabilities, DriverInterface, QueryOptions, StreamOptions, StreamTableData, TableStructure, BaseDriver, UnloadOptions } from '@cubejs-backend/base-driver'; import type { ConnectionOptions as TLSConnectionOptions } from 'tls'; export type PrestoDriverExportBucket = { exportBucket?: string; bucketType?: 'gcs' | 's3'; credentials?: any; accessKeyId?: string; secretAccessKey?: string; exportBucketRegion?: string; exportBucketS3AdvancedFS?: boolean; exportBucketCsvEscapeSymbol?: string; }; export type PrestoDriverInternalConfiguration = { engine?: 'presto' | 'trino'; }; export type PrestoDriverConfiguration = PrestoDriverExportBucket & PrestoDriverInternalConfiguration & { host?: string; port?: string; catalog?: string; schema?: string; user?: string; custom_auth?: string; basic_auth?: { user: string; password: string; }; ssl?: TLSConnectionOptions; dataSource?: string; queryTimeout?: number; preAggregations?: boolean; useSelectTestConnection?: boolean; headers?: Record; timezone?: string; }; /** * Presto driver class. */ export declare class PrestoDriver extends BaseDriver implements DriverInterface { /** * Returns default concurrency value. */ static getDefaultConcurrency(): number; protected readonly config: PrestoDriverConfiguration; protected readonly catalog: string | undefined; protected client: any; protected useSelectTestConnection: boolean; private readonly traceTokenHeader; /** * Class constructor. */ constructor(config?: PrestoDriverConfiguration); /** * https://github.com/tagomoris/presto-client-node/pull/97 * * Reason for monkey patching: * * The underlying `presto-client` only applies custom headers to the initial * `POST /v1/statement` request. The follow-up `nextUri` GET polls (and the * cancel/kill/node requests) are issued with a fresh, empty header set. */ protected applyCustomHeadersToAllRequests(client: any): void; testConnection(): Promise; protected testConnectionViaSelect(): Promise; query(query: string, values: unknown[], options?: QueryOptions): Promise; protected prepareQueryWithParams(query: string, values: unknown[]): string; queryPromised(query: string, streaming: boolean, requestId?: string): Promise; downloadQueryResults(query: string, values: unknown[], options: DownloadQueryResultsOptions): Promise; protected informationSchemaQuery(): string; protected getSchemasQuery(): string; protected getTablesForSpecificSchemasQuery(schemasPlaceholders: string): string; protected getColumnsForSpecificTablesQuery(conditionString: string): string; normalizeResultOverColumns(data: any[], columns: TableStructure): { [x: string]: any; }[]; stream(query: string, values: unknown[], options: StreamOptions): Promise; capabilities(): DriverCapabilities; createSchemaIfNotExists(schemaName: string): Promise; isUnloadSupported(): Promise; unload(tableName: string, options: UnloadOptions): Promise<{ exportBucketCsvEscapeSymbol: string | undefined; csvFile: string[]; types: { name: string; type: string; }[]; csvNoHeader: boolean; }>; private splitTableFullName; private generateTableColumnsForExport; private unloadWithSql; private unloadWithTable; private unloadGeneric; queryColumnTypes(sql: string, params: unknown[], options?: QueryOptions): Promise<{ name: string; type: string; }[]>; private getCsvFiles; } //# sourceMappingURL=PrestoDriver.d.ts.map