Skip to content

Commit 879ea7a

Browse files
committed
fix types in Quest driver
1 parent 16b0c54 commit 879ea7a

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

packages/cubejs-questdb-driver/src/QuestDriver.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ import {
1717
BaseDriver, DownloadQueryResultsOptions,
1818
DownloadTableMemoryData, DriverInterface,
1919
IndexesSQL, TableStructure, QueryOptions,
20+
DatabaseStructure,
2021
} from '@cubejs-backend/base-driver';
2122
import { 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

Comments
 (0)