@lightdash/warehouses 0.2007.3 → 0.2007.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -269,6 +269,7 @@ class SnowflakeWarehouseClient extends WarehouseBaseClient_1.default {
269
269
  await this.executeStatements(connection, sqlStatements.join('\n'), sqlStatements.length);
270
270
  }
271
271
  getFieldsFromStatement(stmt) {
272
+ // There is a bug/mistype in snowflake-sdk since this method can return undefined
272
273
  const columns = stmt.getColumns();
273
274
  return columns
274
275
  ? columns.reduce((acc, column) => ({
@@ -491,13 +492,10 @@ class SnowflakeWarehouseClient extends WarehouseBaseClient_1.default {
491
492
  reject(err);
492
493
  }
493
494
  if (data) {
494
- const fields = stmt.getColumns().reduce((acc, column) => ({
495
- ...acc,
496
- [column.getName()]: {
497
- type: (0, exports.mapFieldType)(column.getType().toUpperCase()),
498
- },
499
- }), {});
500
- resolve({ fields, rows: parseRows(data) });
495
+ resolve({
496
+ fields: this.getFieldsFromStatement(stmt),
497
+ rows: parseRows(data),
498
+ });
501
499
  }
502
500
  else {
503
501
  reject(new common_1.WarehouseQueryError('Query result is undefined'));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lightdash/warehouses",
3
- "version": "0.2007.3",
3
+ "version": "0.2007.4",
4
4
  "license": "MIT",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -16,7 +16,7 @@
16
16
  "snowflake-sdk": "~2.1.3",
17
17
  "ssh2": "^1.14.0",
18
18
  "trino-client": "0.2.6",
19
- "@lightdash/common": "0.2007.3"
19
+ "@lightdash/common": "0.2007.4"
20
20
  },
21
21
  "devDependencies": {
22
22
  "@types/pg": "^8.11.10",