@malloydata/db-trino 0.0.138-dev240402171233 → 0.0.138-dev240402185231
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.
- package/dist/trino_connection.js +3 -3
- package/package.json +1 -1
package/dist/trino_connection.js
CHANGED
|
@@ -174,7 +174,6 @@ class TrinoConnection {
|
|
|
174
174
|
return col;
|
|
175
175
|
}
|
|
176
176
|
convertNest(structDef, dataRows) {
|
|
177
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
178
177
|
const ret = [];
|
|
179
178
|
if (structDef.structRelationship.type === 'nested' &&
|
|
180
179
|
!structDef.structRelationship.isArray) {
|
|
@@ -193,7 +192,8 @@ class TrinoConnection {
|
|
|
193
192
|
let queryResult = await result.next();
|
|
194
193
|
if (queryResult.value.error) {
|
|
195
194
|
// TODO: handle.
|
|
196
|
-
|
|
195
|
+
const { failureInfo: _, ...error } = queryResult.value.error;
|
|
196
|
+
throw new Error(`Failed to execute sql: ${sqlCommand}. \n Error: ${JSON.stringify(error)}`);
|
|
197
197
|
}
|
|
198
198
|
const malloyColumns = queryResult.value.columns.map(c => this.malloyTypeFromTrinoType(c.name, c.type));
|
|
199
199
|
// Debugging types
|
|
@@ -421,7 +421,7 @@ class TrinoConnection {
|
|
|
421
421
|
structDefFromSchema(rows, structDef) {
|
|
422
422
|
for (const row of rows) {
|
|
423
423
|
const name = row[0];
|
|
424
|
-
const type = row[
|
|
424
|
+
const type = row[4] || row[1];
|
|
425
425
|
const malloyType = this.malloyTypeFromTrinoType(name, type);
|
|
426
426
|
// console.log('>', row, '\n<', malloyType);
|
|
427
427
|
structDef.fields.push({ name, ...malloyType });
|