@malloy-publisher/server 0.0.126 → 0.0.128
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/app/api-doc.yaml +3 -0
- package/dist/app/assets/{HomePage-afPX6W7K.js → HomePage-CPVNX7xO.js} +1 -1
- package/dist/app/assets/{MainPage--FWN7r1Z.js → MainPage-D0lkWMk3.js} +1 -1
- package/dist/app/assets/{ModelPage-D3Ihmf2z.js → ModelPage-DL-vlw5W.js} +1 -1
- package/dist/app/assets/{PackagePage-CcV8GAH9.js → PackagePage-D53qNYkE.js} +1 -1
- package/dist/app/assets/ProjectPage-DV_uON2u.js +1 -0
- package/dist/app/assets/{RouteError-C2t12j0f.js → RouteError-3UEJGylT.js} +1 -1
- package/dist/app/assets/{WorkbookPage-K2hzGGsS.js → WorkbookPage-Dj6aGMAX.js} +1 -1
- package/dist/app/assets/{index-CgZNfVij.js → index-COAfgUqD.js} +71 -71
- package/dist/app/assets/{index-CekMDPMU.js → index-D8uueY8S.js} +1 -1
- package/dist/app/assets/{index-BjZ0mSgT.js → index-DrpC2rwe.js} +1 -1
- package/dist/app/assets/{index.umd-BupftRsF.js → index.umd-DItrhqJG.js} +1 -1
- package/dist/app/index.html +1 -1
- package/dist/server.js +27 -17
- package/package.json +1 -1
- package/src/dto/connection.dto.ts +8 -4
- package/src/service/connection.ts +33 -16
- package/src/service/db_utils.ts +7 -1
- package/dist/app/assets/ProjectPage-u_BZ0_QW.js +0 -1
package/package.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import "
|
|
1
|
+
import { Type } from "class-transformer";
|
|
2
2
|
import {
|
|
3
|
-
IsOptional,
|
|
4
|
-
IsString,
|
|
5
3
|
IsEnum,
|
|
6
4
|
IsNumber,
|
|
5
|
+
IsOptional,
|
|
6
|
+
IsString,
|
|
7
7
|
ValidateNested,
|
|
8
8
|
} from "class-validator";
|
|
9
|
-
import
|
|
9
|
+
import "reflect-metadata";
|
|
10
10
|
import { ApiConnection } from "../service/model";
|
|
11
11
|
|
|
12
12
|
export class PostgresConnectionDto {
|
|
@@ -137,6 +137,10 @@ export class TrinoConnectionDto {
|
|
|
137
137
|
@IsOptional()
|
|
138
138
|
@IsString()
|
|
139
139
|
password?: string;
|
|
140
|
+
|
|
141
|
+
@IsOptional()
|
|
142
|
+
@IsString()
|
|
143
|
+
peakaKey?: string;
|
|
140
144
|
}
|
|
141
145
|
|
|
142
146
|
export class ConnectionDto implements ApiConnection {
|
|
@@ -37,29 +37,46 @@ function validateAndBuildTrinoConfig(
|
|
|
37
37
|
trinoConfig.server = `${trinoConfig.server}:${trinoConfig.port}`;
|
|
38
38
|
}
|
|
39
39
|
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
40
|
+
// Build base config
|
|
41
|
+
const baseConfig: {
|
|
42
|
+
server: string;
|
|
43
|
+
port?: number;
|
|
44
|
+
catalog?: string;
|
|
45
|
+
schema?: string;
|
|
46
|
+
user?: string;
|
|
47
|
+
password?: string;
|
|
48
|
+
extraConfig?: Record<string, unknown>;
|
|
49
|
+
} = {
|
|
50
|
+
server: trinoConfig.server,
|
|
51
|
+
port: trinoConfig.port,
|
|
52
|
+
catalog: trinoConfig.catalog,
|
|
53
|
+
schema: trinoConfig.schema,
|
|
54
|
+
user: trinoConfig.user,
|
|
55
|
+
};
|
|
56
|
+
|
|
57
|
+
if (trinoConfig.peakaKey) {
|
|
58
|
+
baseConfig.extraConfig = {
|
|
59
|
+
extraCredential: {
|
|
60
|
+
peakaKey: trinoConfig.peakaKey,
|
|
61
|
+
},
|
|
47
62
|
};
|
|
63
|
+
delete baseConfig.password;
|
|
48
64
|
} else if (
|
|
49
65
|
trinoConfig.server?.startsWith("https://") &&
|
|
50
66
|
trinoConfig.password
|
|
51
67
|
) {
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
68
|
+
// Only add password if no peakaKey and HTTPS connection
|
|
69
|
+
baseConfig.password = trinoConfig.password;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
if (trinoConfig.server?.startsWith("http://")) {
|
|
73
|
+
delete baseConfig.password;
|
|
74
|
+
return baseConfig;
|
|
75
|
+
} else if (trinoConfig.server?.startsWith("https://")) {
|
|
76
|
+
return baseConfig;
|
|
60
77
|
} else {
|
|
61
78
|
throw new Error(
|
|
62
|
-
`Invalid Trino connection: expected "http://server:port"
|
|
79
|
+
`Invalid Trino connection: expected "http://server:port" or "https://server:port".`,
|
|
63
80
|
);
|
|
64
81
|
}
|
|
65
82
|
}
|
package/src/service/db_utils.ts
CHANGED
|
@@ -313,7 +313,13 @@ export async function getTablesForSchema(
|
|
|
313
313
|
// Fetch all table sources in parallel
|
|
314
314
|
const tableSourcePromises = tableNames.map(async (tableName) => {
|
|
315
315
|
try {
|
|
316
|
-
|
|
316
|
+
let tablePath: string;
|
|
317
|
+
|
|
318
|
+
if (connection.type === "trino") {
|
|
319
|
+
tablePath = `${connection.trinoConnection?.catalog}.${schemaName}.${tableName}`;
|
|
320
|
+
} else {
|
|
321
|
+
tablePath = `${schemaName}.${tableName}`;
|
|
322
|
+
}
|
|
317
323
|
|
|
318
324
|
logger.info(
|
|
319
325
|
`Processing table: ${tableName} in schema: ${schemaName}`,
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{q as a,t as n,j as e,D as o,G as c}from"./index-CgZNfVij.js";function j(){const r=a(),{projectName:s}=n();if(s){const t=o({projectName:s});return e.jsx(c,{onSelectPackage:r,resourceUri:t})}else return e.jsx("div",{children:e.jsx("h2",{children:"Missing project name"})})}export{j as default};
|