@malloy-publisher/server 0.0.133 → 0.0.134
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/server.js +3 -0
- package/package.json +1 -1
- package/src/service/db_utils.ts +7 -0
package/dist/server.js
CHANGED
|
@@ -132696,6 +132696,9 @@ async function getConnectionTableSource(malloyConnection, tableKey, tablePath) {
|
|
|
132696
132696
|
if (!malloyFields || !Array.isArray(malloyFields)) {
|
|
132697
132697
|
throw new ConnectionError(`Table ${tablePath} has no fields or invalid field structure`);
|
|
132698
132698
|
}
|
|
132699
|
+
if (malloyFields.length === 0) {
|
|
132700
|
+
throw new ConnectionError(`Table ${tablePath} not found`);
|
|
132701
|
+
}
|
|
132699
132702
|
const fields = malloyFields.map((field) => {
|
|
132700
132703
|
return {
|
|
132701
132704
|
name: field.name,
|
package/package.json
CHANGED
package/src/service/db_utils.ts
CHANGED
|
@@ -437,6 +437,13 @@ export async function getConnectionTableSource(
|
|
|
437
437
|
);
|
|
438
438
|
}
|
|
439
439
|
|
|
440
|
+
//This is for the Trino connection. The connection will not throw an error if the table is not found.
|
|
441
|
+
// Instead it will return an empty fields array. So we need to check for that.
|
|
442
|
+
// But it is fine to have it for all other connections as well.
|
|
443
|
+
if (malloyFields.length === 0) {
|
|
444
|
+
throw new ConnectionError(`Table ${tablePath} not found`);
|
|
445
|
+
}
|
|
446
|
+
|
|
440
447
|
const fields = malloyFields.map((field) => {
|
|
441
448
|
return {
|
|
442
449
|
name: field.name,
|