File tree Expand file tree Collapse file tree 1 file changed +17
-0
lines changed
packages/cubejs-redshift-driver/src Expand file tree Collapse file tree 1 file changed +17
-0
lines changed Original file line number Diff line number Diff line change @@ -178,6 +178,23 @@ export class RedshiftDriver extends PostgresDriver<RedshiftDriverConfiguration>
178178 . map ( s => ( { schema_name : s . schema_name } ) ) ;
179179 }
180180
181+ public async getTablesForSpecificSchemas ( schemas : QuerySchemasResult [ ] ) : Promise < QueryTablesResult [ ] > {
182+ const tables = await super . getTablesForSpecificSchemas ( schemas ) ;
183+
184+ // We might request the external schemas and tables, their descriptions won't be returned
185+ // by the super.getTablesForSpecificSchemas(). Need to request them separately.
186+ const missedSchemas = schemas . filter ( s => ! tables . some ( t => t . schema_name === s . schema_name ) ) ;
187+
188+ for ( const externalSchema of missedSchemas ) {
189+ const tablesRes = await this . tablesForExternalSchema ( externalSchema . schema_name ) ;
190+ tablesRes . forEach ( t => {
191+ tables . push ( { schema_name : externalSchema . schema_name , table_name : t . table_name } ) ;
192+ } ) ;
193+ }
194+
195+ return tables ;
196+ }
197+
181198 public async getColumnsForSpecificTables ( tables : QueryTablesResult [ ] ) : Promise < QueryColumnsResult [ ] > {
182199 const columns = await super . getColumnsForSpecificTables ( tables ) ;
183200
You can’t perform that action at this time.
0 commit comments