Skip to content

Commit 4360ceb

Browse files
committed
fix types in Materialize driver
1 parent d29b270 commit 4360ceb

File tree

3 files changed

+17
-20
lines changed

3 files changed

+17
-20
lines changed

packages/cubejs-materialize-driver/package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@
3232
"@cubejs-backend/shared": "^1.0.2",
3333
"@types/pg": "^8.6.0",
3434
"pg": "^8.6.0",
35-
"ramda": "0.27.2",
3635
"semver": "7.3.7"
3736
},
3837
"license": "Apache-2.0",

packages/cubejs-materialize-driver/src/MaterializeDriver.ts

Lines changed: 12 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,16 @@
55
*/
66

77
import { PostgresDriver, PostgresDriverConfiguration } from '@cubejs-backend/postgres-driver';
8-
import { BaseDriver, DownloadTableMemoryData, IndexesSQL, StreamOptions, StreamTableDataWithTypes, TableStructure } from '@cubejs-backend/base-driver';
8+
import {
9+
BaseDriver,
10+
DatabaseStructure,
11+
DownloadTableMemoryData,
12+
IndexesSQL,
13+
StreamOptions,
14+
StreamTableDataWithTypes,
15+
TableStructure
16+
} from '@cubejs-backend/base-driver';
917
import { PoolClient, QueryResult } from 'pg';
10-
import { reduce } from 'ramda';
1118
import { Readable } from 'stream';
1219
import semver from 'semver';
1320

@@ -18,16 +25,6 @@ export type ReadableStreamTableDataWithTypes = StreamTableDataWithTypes & {
1825
rowStream: Readable;
1926
};
2027

21-
export type SchemaResponse = {
22-
[schema: string]: {
23-
[schemaObject: string]: {
24-
name: string;
25-
type: string;
26-
attributes: any[];
27-
}[];
28-
}
29-
};
30-
3128
/**
3229
* Materialize driver class.
3330
*/
@@ -73,6 +70,7 @@ export class MaterializeDriver extends PostgresDriver {
7370
/**
7471
* Application name to set for the connection.
7572
*/
73+
// eslint-disable-next-line camelcase
7674
application_name?: string,
7775
} = {},
7876
) {
@@ -175,11 +173,11 @@ export class MaterializeDriver extends PostgresDriver {
175173
return version.split(' ')[0];
176174
}
177175

178-
public async tablesSchema(): Promise<SchemaResponse> {
176+
public async tablesSchema(): Promise<DatabaseStructure> {
179177
const version = await this.getMaterializeVersion();
180178
const query = this.informationSchemaQueryWithFilter(version);
181179

182-
return this.query(query, []).then(data => reduce(this.informationColumnsSchemaReducer, {}, data));
180+
return this.query(query, []).then(data => data.reduce<DatabaseStructure>(this.informationColumnsSchemaReducer, {}));
183181
}
184182

185183
protected async* asyncFetcher<R extends unknown>(conn: PoolClient, cursorId: string): AsyncGenerator<R> {

yarn.lock

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24487,16 +24487,16 @@ raf@^3.4.0:
2448724487
dependencies:
2448824488
performance-now "^2.1.0"
2448924489

24490-
[email protected], ramda@^0.27.2:
24491-
version "0.27.2"
24492-
resolved "https://registry.yarnpkg.com/ramda/-/ramda-0.27.2.tgz#84463226f7f36dc33592f6f4ed6374c48306c3f1"
24493-
integrity sha512-SbiLPU40JuJniHexQSAgad32hfwd+DRUdwF2PlVuI5RZD0/vahUco7R8vD86J/tcEKKF9vZrUVwgtmGCqlCKyA==
24494-
2449524490
ramda@^0.27.0, ramda@^0.27.1, ramda@~0.27.1:
2449624491
version "0.27.1"
2449724492
resolved "https://registry.yarnpkg.com/ramda/-/ramda-0.27.1.tgz#66fc2df3ef873874ffc2da6aa8984658abacf5c9"
2449824493
integrity sha512-PgIdVpn5y5Yns8vqb8FzBUEYn98V3xcPgawAkkgj0YJ0qDsnHCiNmZYfOGMgOvoB0eWFLpYbhxUR3mxfDIMvpw==
2449924494

24495+
ramda@^0.27.2:
24496+
version "0.27.2"
24497+
resolved "https://registry.yarnpkg.com/ramda/-/ramda-0.27.2.tgz#84463226f7f36dc33592f6f4ed6374c48306c3f1"
24498+
integrity sha512-SbiLPU40JuJniHexQSAgad32hfwd+DRUdwF2PlVuI5RZD0/vahUco7R8vD86J/tcEKKF9vZrUVwgtmGCqlCKyA==
24499+
2450024500
ramda@^0.28.0:
2450124501
version "0.28.0"
2450224502
resolved "https://registry.yarnpkg.com/ramda/-/ramda-0.28.0.tgz#acd785690100337e8b063cab3470019be427cc97"

0 commit comments

Comments
 (0)