/** * @copyright Cube Dev, Inc. * @license Apache-2.0 * @fileoverview The `BigQueryDriver` and related types declaration. */ import { Required } from '@cubejs-backend/shared'; import { BigQuery, BigQueryOptions, Dataset, Job, QueryRowsResponse } from '@google-cloud/bigquery'; import { Bucket, Storage } from '@google-cloud/storage'; import { BaseDriver, DatabaseStructure, DriverCapabilities, DriverInterface, QueryColumnsResult, QueryOptions, QuerySchemasResult, QueryTablesResult, StreamOptions, StreamTableData, TableCSVData } from '@cubejs-backend/base-driver'; import type { Query } from '@google-cloud/bigquery/build/src/bigquery'; interface BigQueryDriverOptions extends BigQueryOptions { readOnly?: boolean; projectId?: string; keyFilename?: string; exportBucket?: string; location?: string; pollTimeout?: number; pollMaxInterval?: number; /** * The export bucket CSV file escape symbol. */ exportBucketCsvEscapeSymbol?: string; } type BigQueryDriverOptionsInitialized = Required; /** * BigQuery driver. */ export declare class BigQueryDriver extends BaseDriver implements DriverInterface { /** * Returns default concurrency value. */ static getDefaultConcurrency(): number; protected readonly options: BigQueryDriverOptionsInitialized; protected readonly bigquery: BigQuery; protected readonly storage: Storage | null; protected readonly bucket: Bucket | null; /** * Class constructor. */ constructor(config?: BigQueryDriverOptions & { /** * 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; }); /** * Returns the configurable driver options * Note: It returns the unprefixed option names. * In case of using multisources options need to be prefixed manually. */ static driverEnvVariables(): string[]; testConnection(): Promise; readOnly(): boolean; query(query: string, values: unknown[], options?: QueryOptions): Promise; protected loadTablesForDataset(dataset: Dataset): Promise; tablesSchema(): Promise; getSchemas(): Promise; getTablesForSpecificSchemas(schemas: QuerySchemasResult[]): Promise; getColumnsForSpecificTables(tables: QueryTablesResult[]): Promise; getTablesQuery(schemaName: string): Promise<{ table_name: string | undefined; }[]>; tableColumnTypes(table: string): Promise; createSchemaIfNotExists(schemaName: string): Promise; isUnloadSupported(): Promise; stream(query: string, values: unknown[], options?: StreamOptions): Promise; unload(table: string): Promise; loadPreAggregationIntoTable(preAggregationTableName: string, loadSql: string, params: any, options: any): Promise; protected awaitForJobStatus(job: Job, options: any, withResults: boolean): Promise; /** * @see https://cloud.google.com/bigquery/docs/labels-intro#requirements */ protected buildQueryLabels(options?: QueryOptions): { [k: string]: string; } | undefined; protected runQueryJob(bigQueryQuery: Query, options: any, withResults?: boolean): Promise; protected waitForJobResult(job: Job, options: any, withResults: boolean): Promise; quoteIdentifier(identifier: string): string; capabilities(): DriverCapabilities; protected toGenericType(columnType: string, precision?: number | null, scale?: number | null): string; } export {}; //# sourceMappingURL=BigQueryDriver.d.ts.map