diff --git a/packages/cubejs-base-driver/src/BaseDriver.ts b/packages/cubejs-base-driver/src/BaseDriver.ts index b4d0f50de80ba..bfd44df407503 100644 --- a/packages/cubejs-base-driver/src/BaseDriver.ts +++ b/packages/cubejs-base-driver/src/BaseDriver.ts @@ -470,12 +470,12 @@ export abstract class BaseDriver implements DriverInterface { } } - public getSchemas() { + public getSchemas(): Promise { const query = this.getSchemasQuery(); return this.query(query); } - public getTablesForSpecificSchemas(schemas: QuerySchemasResult[]) { + public getTablesForSpecificSchemas(schemas: QuerySchemasResult[]): Promise { const schemasPlaceholders = schemas.map((_, idx) => this.param(idx)).join(', '); const schemaNames = schemas.map(s => s.schema_name); @@ -483,7 +483,7 @@ export abstract class BaseDriver implements DriverInterface { return this.query(query, schemaNames); } - public async getColumnsForSpecificTables(tables: QueryTablesResult[]) { + public async getColumnsForSpecificTables(tables: QueryTablesResult[]): Promise { const groupedBySchema: Record = {}; tables.forEach((t) => { if (!groupedBySchema[t.schema_name]) { diff --git a/packages/cubejs-bigquery-driver/src/BigQueryDriver.ts b/packages/cubejs-bigquery-driver/src/BigQueryDriver.ts index 3ddbf35d4d7ee..1915a1a8b0bec 100644 --- a/packages/cubejs-bigquery-driver/src/BigQueryDriver.ts +++ b/packages/cubejs-bigquery-driver/src/BigQueryDriver.ts @@ -222,14 +222,14 @@ export class BigQueryDriver extends BaseDriver implements DriverInterface { return dataSetsColumns.reduce((prev, current) => Object.assign(prev, current), {}); } - public async getSchemas(): Promise { + public override async getSchemas(): Promise { const dataSets = await this.bigquery.getDatasets(); return dataSets[0].filter((dataSet) => dataSet.id).map((dataSet) => ({ schema_name: dataSet.id!, })); } - public async getTablesForSpecificSchemas(schemas: QuerySchemasResult[]): Promise { + public override async getTablesForSpecificSchemas(schemas: QuerySchemasResult[]): Promise { try { const allTablePromises = schemas.map(async schema => { const tables = await this.getTablesQuery(schema.schema_name); @@ -247,7 +247,7 @@ export class BigQueryDriver extends BaseDriver implements DriverInterface { } } - public async getColumnsForSpecificTables(tables: QueryTablesResult[]): Promise { + public override async getColumnsForSpecificTables(tables: QueryTablesResult[]): Promise { try { const allColumnPromises = tables.map(async table => { const tableName = `${table.schema_name}.${table.table_name}`; diff --git a/packages/cubejs-redshift-driver/src/RedshiftDriver.ts b/packages/cubejs-redshift-driver/src/RedshiftDriver.ts index e07cd1752492b..8f031d61d3e16 100644 --- a/packages/cubejs-redshift-driver/src/RedshiftDriver.ts +++ b/packages/cubejs-redshift-driver/src/RedshiftDriver.ts @@ -103,7 +103,7 @@ export class RedshiftDriver extends PostgresDriver /** * @override */ - protected informationSchemaQuery() { + protected override informationSchemaQuery() { return ` SELECT columns.column_name as ${this.quoteIdentifier('column_name')}, columns.table_name as ${this.quoteIdentifier('table_name')}, @@ -119,7 +119,7 @@ export class RedshiftDriver extends PostgresDriver * so it needs to be queried separately. * @override */ - public async tablesSchema(): Promise { + public override async tablesSchema(): Promise { const query = this.informationSchemaQuery(); const tablesSchema = await this.query(query, []).then(data => data.reduce(this.informationColumnsSchemaReducer, {})); @@ -155,7 +155,7 @@ export class RedshiftDriver extends PostgresDriver /** * @override */ - protected getSchemasQuery() { + protected override getSchemasQuery() { return ` SELECT table_schema as ${this.quoteIdentifier('schema_name')} FROM information_schema.tables @@ -170,7 +170,7 @@ export class RedshiftDriver extends PostgresDriver * It returns regular schemas (queryable from information_schema) and external ones. * @override */ - public async getSchemas(): Promise { + public override async getSchemas(): Promise { const schemas = await this.query(`SHOW SCHEMAS FROM DATABASE ${this.dbName}`, []); return schemas @@ -178,7 +178,7 @@ export class RedshiftDriver extends PostgresDriver .map(s => ({ schema_name: s.schema_name })); } - public async getTablesForSpecificSchemas(schemas: QuerySchemasResult[]): Promise { + public override async getTablesForSpecificSchemas(schemas: QuerySchemasResult[]): Promise { const tables = await super.getTablesForSpecificSchemas(schemas); // We might request the external schemas and tables, their descriptions won't be returned @@ -195,7 +195,7 @@ export class RedshiftDriver extends PostgresDriver return tables; } - public async getColumnsForSpecificTables(tables: QueryTablesResult[]): Promise { + public override async getColumnsForSpecificTables(tables: QueryTablesResult[]): Promise { const columns = await super.getColumnsForSpecificTables(tables); // We might request the external tables, their descriptions won't be returned @@ -245,7 +245,7 @@ export class RedshiftDriver extends PostgresDriver * And querying even system tables is billed. * @override */ - public async testConnection() { + public override async testConnection() { const conn = await this.pool.connect(); conn.release(); }