@@ -17,6 +17,7 @@ import {
1717 BaseDriver , DownloadQueryResultsOptions ,
1818 DownloadTableMemoryData , DriverInterface ,
1919 IndexesSQL , TableStructure , QueryOptions ,
20+ DatabaseStructure ,
2021} from '@cubejs-backend/base-driver' ;
2122import { QuestQuery } from './QuestQuery' ;
2223
@@ -179,14 +180,14 @@ export class QuestDriver<Config extends QuestDriverConfiguration = QuestDriverCo
179180 // no-op as there are no schemas in QuestDB
180181 }
181182
182- public async tablesSchema ( ) {
183+ public async tablesSchema ( ) : Promise < DatabaseStructure > {
183184 const tables = await this . getTablesQuery ( '' ) ;
184185
185186 // QuestDB doesn't have a notion of schema/logical database while the driver
186187 // has to return a `{ 'schema_name': { 'table1': {...} } }` object. So, we use
187188 // empty schema name ('') as a workaround to avoid the schema prefix
188189 // ('schema_name.') being used for table names in the generated queries.
189- const metadata : Record < string , Record < string , object > > = { '' : { } } ;
190+ const metadata : DatabaseStructure = { '' : { } } ;
190191
191192 // eslint-disable-next-line camelcase
192193 await Promise . all ( tables . map ( async ( { table_name : tableName } ) => {
@@ -209,7 +210,7 @@ export class QuestDriver<Config extends QuestDriverConfiguration = QuestDriverCo
209210 return this . query ( 'SHOW TABLES' , [ ] ) ;
210211 }
211212
212- public async tableColumnTypes ( table : string ) {
213+ public async tableColumnTypes ( table : string ) : Promise < TableStructure > {
213214 const response : any [ ] = await this . query ( `SHOW COLUMNS FROM '${ table } '` , [ ] ) ;
214215
215216 return response . map ( ( row ) => ( { name : row . column , type : this . toGenericType ( row . type ) } ) ) ;
0 commit comments