@lightdash/warehouses 3.73.0 → 3.73.2
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.
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TrinoWarehouseClient.d.ts","sourceRoot":"","sources":["../../src/warehouseClients/TrinoWarehouseClient.ts"],"names":[],"mappings":"AAAA,OAAO,EAGH,sBAAsB,EAGtB,MAAM,EAIN,mBAAmB,EACnB,gBAAgB,EAGhB,gBAAgB,EAChB,cAAc,EACd,KAAK,iBAAiB,EACtB,KAAK,eAAe,EACvB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAEH,iBAAiB,EAKpB,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;AAO5C,OAAO,mBAAmB,MAAM,uBAAuB,CAAC;AACxD,OAAO,uBAAuB,MAAM,2BAA2B,CAAC;AAiBhE,oBAAY,UAAU;IAClB,OAAO,YAAY;IACnB,OAAO,YAAY;IACnB,QAAQ,aAAa;IACrB,OAAO,YAAY;IACnB,MAAM,WAAW;IACjB,IAAI,SAAS;IACb,MAAM,WAAW;IACjB,OAAO,YAAY;IACnB,OAAO,YAAY;IACnB,IAAI,SAAS;IACb,SAAS,cAAc;IACvB,IAAI,SAAS;IACb,IAAI,SAAS;IACb,IAAI,SAAS;IACb,OAAO,wBAAwB;IAC/B,SAAS,cAAc;IACvB,YAAY,6BAA6B;IACzC,mBAAmB,2BAA2B;IAC9C,iBAAiB,2BAA2B;IAC5C,KAAK,UAAU;IACf,GAAG,QAAQ;IACX,GAAG,QAAQ;IACX,SAAS,cAAc;IACvB,IAAI,SAAS;CAChB;AAED,UAAU,SAAS;IACf,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;CACjB;
|
|
1
|
+
{"version":3,"file":"TrinoWarehouseClient.d.ts","sourceRoot":"","sources":["../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EAAE,MAAM,EACf,QAAQ,CAAC,EAAE,MAAM,EACjB,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAC9B,OAAO,CAAC,gBAAgB,CAAC,CA2B3B;IAEK,YAAY;;;;;SAqBjB;CACJ"}
|
|
@@ -48,6 +48,35 @@ var TrinoTypes;
|
|
|
48
48
|
TrinoTypes["IPADDRESS"] = "ipaddress";
|
|
49
49
|
TrinoTypes["UUID"] = "uuid";
|
|
50
50
|
})(TrinoTypes || (exports.TrinoTypes = TrinoTypes = {}));
|
|
51
|
+
const transportErrorCodes = new Set([
|
|
52
|
+
'ECONNABORTED',
|
|
53
|
+
'ECONNREFUSED',
|
|
54
|
+
'ECONNRESET',
|
|
55
|
+
'EHOSTUNREACH',
|
|
56
|
+
'ENETUNREACH',
|
|
57
|
+
'ENOTFOUND',
|
|
58
|
+
'EAI_AGAIN',
|
|
59
|
+
'ETIMEDOUT',
|
|
60
|
+
'EPIPE',
|
|
61
|
+
]);
|
|
62
|
+
const getTransportErrorCode = (error) => error instanceof Error &&
|
|
63
|
+
'code' in error &&
|
|
64
|
+
typeof error.code === 'string' &&
|
|
65
|
+
transportErrorCodes.has(error.code)
|
|
66
|
+
? error.code
|
|
67
|
+
: undefined;
|
|
68
|
+
const getSanitizedTransportCause = (error) => {
|
|
69
|
+
const code = getTransportErrorCode(error);
|
|
70
|
+
if (!code || !(error instanceof Error))
|
|
71
|
+
return undefined;
|
|
72
|
+
const aggregate = error.cause instanceof AggregateError ? error.cause : error;
|
|
73
|
+
const connectionErrorCodes = 'errors' in aggregate && Array.isArray(aggregate.errors)
|
|
74
|
+
? aggregate.errors
|
|
75
|
+
.map(getTransportErrorCode)
|
|
76
|
+
.filter((value) => value !== undefined)
|
|
77
|
+
: [];
|
|
78
|
+
return { code, connectionErrorCodes: [...new Set(connectionErrorCodes)] };
|
|
79
|
+
};
|
|
51
80
|
const getSanitizedHttpCause = (error) => {
|
|
52
81
|
if (typeof error !== 'object' ||
|
|
53
82
|
error === null ||
|
|
@@ -80,7 +109,7 @@ const sanitizeTrinoCause = (cause) => {
|
|
|
80
109
|
errorCode: cause.errorCode,
|
|
81
110
|
errorType: cause.errorType,
|
|
82
111
|
};
|
|
83
|
-
return getSanitizedHttpCause(cause);
|
|
112
|
+
return getSanitizedHttpCause(cause) ?? getSanitizedTransportCause(cause);
|
|
84
113
|
};
|
|
85
114
|
const getErrorMessage = (e) => {
|
|
86
115
|
// Trino returns Object of type QueryError
|
|
@@ -88,6 +117,13 @@ const getErrorMessage = (e) => {
|
|
|
88
117
|
// Convert Object to Error
|
|
89
118
|
return (0, common_1.getErrorMessage)(new Error(e.message, { cause: e }));
|
|
90
119
|
}
|
|
120
|
+
const transport = getSanitizedTransportCause(e);
|
|
121
|
+
if (transport) {
|
|
122
|
+
const codes = [
|
|
123
|
+
...new Set([transport.code, ...transport.connectionErrorCodes]),
|
|
124
|
+
];
|
|
125
|
+
return `Trino connection failed (${codes.join(', ')})`;
|
|
126
|
+
}
|
|
91
127
|
return (0, common_1.getErrorMessage)(e);
|
|
92
128
|
};
|
|
93
129
|
const queryTableSchema = ({ database, schema, table, }) => `SELECT table_catalog
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lightdash/warehouses",
|
|
3
|
-
"version": "3.73.
|
|
3
|
+
"version": "3.73.2",
|
|
4
4
|
"description": "Warehouse connectors for Lightdash",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
"@databricks/sql": "1.13.0",
|
|
22
22
|
"@duckdb/node-api": "1.5.2-r.2",
|
|
23
23
|
"@google-cloud/bigquery": "8.3.1",
|
|
24
|
-
"@lightdash/common": "3.73.
|
|
24
|
+
"@lightdash/common": "3.73.2",
|
|
25
25
|
"node-fetch": "2.7.0",
|
|
26
26
|
"pg": "8.13.1",
|
|
27
27
|
"pg-cursor": "2.10.0",
|