@finos/legend-graph 32.1.12 → 32.1.14
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/lib/graph/Core_HashUtils.d.ts +1 -0
- package/lib/graph/Core_HashUtils.d.ts.map +1 -1
- package/lib/graph/Core_HashUtils.js +2 -0
- package/lib/graph/Core_HashUtils.js.map +1 -1
- package/lib/graph/MetaModelConst.d.ts +17 -0
- package/lib/graph/MetaModelConst.d.ts.map +1 -1
- package/lib/graph/MetaModelConst.js +18 -0
- package/lib/graph/MetaModelConst.js.map +1 -1
- package/lib/graph/metamodel/pure/packageableElements/store/relational/connection/RelationalDatabaseConnection.d.ts +2 -0
- package/lib/graph/metamodel/pure/packageableElements/store/relational/connection/RelationalDatabaseConnection.d.ts.map +1 -1
- package/lib/graph/metamodel/pure/packageableElements/store/relational/connection/RelationalDatabaseConnection.js +2 -0
- package/lib/graph/metamodel/pure/packageableElements/store/relational/connection/RelationalDatabaseConnection.js.map +1 -1
- package/lib/graph/metamodel/pure/packageableElements/store/relational/connection/RelationalQueryGenerationConfig.d.ts +26 -0
- package/lib/graph/metamodel/pure/packageableElements/store/relational/connection/RelationalQueryGenerationConfig.d.ts.map +1 -0
- package/lib/graph/metamodel/pure/packageableElements/store/relational/connection/RelationalQueryGenerationConfig.js +32 -0
- package/lib/graph/metamodel/pure/packageableElements/store/relational/connection/RelationalQueryGenerationConfig.js.map +1 -0
- package/lib/graph-manager/action/changeDetection/STO_Relational_ObserverHelper.d.ts +4 -0
- package/lib/graph-manager/action/changeDetection/STO_Relational_ObserverHelper.d.ts.map +1 -1
- package/lib/graph-manager/action/changeDetection/STO_Relational_ObserverHelper.js +24 -0
- package/lib/graph-manager/action/changeDetection/STO_Relational_ObserverHelper.js.map +1 -1
- package/lib/graph-manager/protocol/pure/v1/model/packageableElements/store/relational/connection/V1_RelationalDatabaseConnection.d.ts +2 -0
- package/lib/graph-manager/protocol/pure/v1/model/packageableElements/store/relational/connection/V1_RelationalDatabaseConnection.d.ts.map +1 -1
- package/lib/graph-manager/protocol/pure/v1/model/packageableElements/store/relational/connection/V1_RelationalDatabaseConnection.js +2 -0
- package/lib/graph-manager/protocol/pure/v1/model/packageableElements/store/relational/connection/V1_RelationalDatabaseConnection.js.map +1 -1
- package/lib/graph-manager/protocol/pure/v1/model/packageableElements/store/relational/connection/V1_RelationalQueryGenerationConfig.d.ts +25 -0
- package/lib/graph-manager/protocol/pure/v1/model/packageableElements/store/relational/connection/V1_RelationalQueryGenerationConfig.d.ts.map +1 -0
- package/lib/graph-manager/protocol/pure/v1/model/packageableElements/store/relational/connection/V1_RelationalQueryGenerationConfig.js +31 -0
- package/lib/graph-manager/protocol/pure/v1/model/packageableElements/store/relational/connection/V1_RelationalQueryGenerationConfig.js.map +1 -0
- package/lib/graph-manager/protocol/pure/v1/transformation/pureGraph/from/V1_ConnectionTransformer.d.ts.map +1 -1
- package/lib/graph-manager/protocol/pure/v1/transformation/pureGraph/from/V1_ConnectionTransformer.js +4 -0
- package/lib/graph-manager/protocol/pure/v1/transformation/pureGraph/from/V1_ConnectionTransformer.js.map +1 -1
- package/lib/graph-manager/protocol/pure/v1/transformation/pureGraph/from/V1_QueryGenerationConfigTransformer.d.ts +20 -0
- package/lib/graph-manager/protocol/pure/v1/transformation/pureGraph/from/V1_QueryGenerationConfigTransformer.d.ts.map +1 -0
- package/lib/graph-manager/protocol/pure/v1/transformation/pureGraph/from/V1_QueryGenerationConfigTransformer.js +28 -0
- package/lib/graph-manager/protocol/pure/v1/transformation/pureGraph/from/V1_QueryGenerationConfigTransformer.js.map +1 -0
- package/lib/graph-manager/protocol/pure/v1/transformation/pureGraph/to/helpers/V1_ConnectionBuilderHelper.d.ts.map +1 -1
- package/lib/graph-manager/protocol/pure/v1/transformation/pureGraph/to/helpers/V1_ConnectionBuilderHelper.js +2 -0
- package/lib/graph-manager/protocol/pure/v1/transformation/pureGraph/to/helpers/V1_ConnectionBuilderHelper.js.map +1 -1
- package/lib/graph-manager/protocol/pure/v1/transformation/pureGraph/to/helpers/V1_QueryGenerationConfigBuilderHelper.d.ts +20 -0
- package/lib/graph-manager/protocol/pure/v1/transformation/pureGraph/to/helpers/V1_QueryGenerationConfigBuilderHelper.d.ts.map +1 -0
- package/lib/graph-manager/protocol/pure/v1/transformation/pureGraph/to/helpers/V1_QueryGenerationConfigBuilderHelper.js +28 -0
- package/lib/graph-manager/protocol/pure/v1/transformation/pureGraph/to/helpers/V1_QueryGenerationConfigBuilderHelper.js.map +1 -0
- package/lib/graph-manager/protocol/pure/v1/transformation/pureProtocol/serializationHelpers/V1_DatabaseSerializationHelper.d.ts.map +1 -1
- package/lib/graph-manager/protocol/pure/v1/transformation/pureProtocol/serializationHelpers/V1_DatabaseSerializationHelper.js +2 -0
- package/lib/graph-manager/protocol/pure/v1/transformation/pureProtocol/serializationHelpers/V1_DatabaseSerializationHelper.js.map +1 -1
- package/lib/graph-manager/protocol/pure/v1/transformation/pureProtocol/serializationHelpers/V1_QueryGenerationConfigSerializationHelper.d.ts +21 -0
- package/lib/graph-manager/protocol/pure/v1/transformation/pureProtocol/serializationHelpers/V1_QueryGenerationConfigSerializationHelper.d.ts.map +1 -0
- package/lib/graph-manager/protocol/pure/v1/transformation/pureProtocol/serializationHelpers/V1_QueryGenerationConfigSerializationHelper.js +43 -0
- package/lib/graph-manager/protocol/pure/v1/transformation/pureProtocol/serializationHelpers/V1_QueryGenerationConfigSerializationHelper.js.map +1 -0
- package/lib/package.json +1 -1
- package/package.json +1 -1
- package/src/graph/Core_HashUtils.ts +3 -0
- package/src/graph/MetaModelConst.ts +18 -0
- package/src/graph/metamodel/pure/packageableElements/store/relational/connection/RelationalDatabaseConnection.ts +3 -0
- package/src/graph/metamodel/pure/packageableElements/store/relational/connection/RelationalQueryGenerationConfig.ts +40 -0
- package/src/graph-manager/action/changeDetection/STO_Relational_ObserverHelper.ts +39 -0
- package/src/graph-manager/protocol/pure/v1/model/packageableElements/store/relational/connection/V1_RelationalDatabaseConnection.ts +3 -0
- package/src/graph-manager/protocol/pure/v1/model/packageableElements/store/relational/connection/V1_RelationalQueryGenerationConfig.ts +38 -0
- package/src/graph-manager/protocol/pure/v1/transformation/pureGraph/from/V1_ConnectionTransformer.ts +6 -0
- package/src/graph-manager/protocol/pure/v1/transformation/pureGraph/from/V1_QueryGenerationConfigTransformer.ts +43 -0
- package/src/graph-manager/protocol/pure/v1/transformation/pureGraph/to/helpers/V1_ConnectionBuilderHelper.ts +4 -0
- package/src/graph-manager/protocol/pure/v1/transformation/pureGraph/to/helpers/V1_QueryGenerationConfigBuilderHelper.ts +43 -0
- package/src/graph-manager/protocol/pure/v1/transformation/pureProtocol/serializationHelpers/V1_DatabaseSerializationHelper.ts +10 -0
- package/src/graph-manager/protocol/pure/v1/transformation/pureProtocol/serializationHelpers/V1_QueryGenerationConfigSerializationHelper.ts +77 -0
- package/tsconfig.json +5 -0
|
@@ -132,6 +132,10 @@ import type { DEPRECATED__RelationalInputData } from '../../../graph/metamodel/p
|
|
|
132
132
|
import { INTERNAL__UnknownPostProcessor } from '../../../graph/metamodel/pure/packageableElements/store/relational/connection/postprocessor/INTERNAL__UnknownPostProcessor.js';
|
|
133
133
|
import { INTERNAL__UnknownDatasourceSpecification } from '../../../graph/metamodel/pure/packageableElements/store/relational/connection/INTERNAL__UnknownDatasourceSpecification.js';
|
|
134
134
|
import { INTERNAL__UnknownAuthenticationStrategy } from '../../../graph/metamodel/pure/packageableElements/store/relational/connection/INTERNAL__UnknownAuthenticationStrategy.js';
|
|
135
|
+
import {
|
|
136
|
+
type RelationalQueryGenerationConfig,
|
|
137
|
+
GenerationFeaturesConfig,
|
|
138
|
+
} from '../../../graph/metamodel/pure/packageableElements/store/relational/connection/RelationalQueryGenerationConfig.js';
|
|
135
139
|
|
|
136
140
|
// ------------------------------------- Operation -------------------------------------
|
|
137
141
|
|
|
@@ -1194,6 +1198,36 @@ export const observe_PostProcessor = (
|
|
|
1194
1198
|
return metamodel;
|
|
1195
1199
|
};
|
|
1196
1200
|
|
|
1201
|
+
export const observe_Abstract_RelationalQueryGenerationConfig = (
|
|
1202
|
+
metamodel: RelationalQueryGenerationConfig,
|
|
1203
|
+
): void => {
|
|
1204
|
+
makeObservable(metamodel, {
|
|
1205
|
+
hashCode: computed,
|
|
1206
|
+
});
|
|
1207
|
+
};
|
|
1208
|
+
|
|
1209
|
+
export const observe_GenerationFeaturesConfig = (
|
|
1210
|
+
metamodel: GenerationFeaturesConfig,
|
|
1211
|
+
): GenerationFeaturesConfig => {
|
|
1212
|
+
observe_Abstract_RelationalQueryGenerationConfig(metamodel);
|
|
1213
|
+
|
|
1214
|
+
makeObservable(metamodel, {
|
|
1215
|
+
enabled: observable,
|
|
1216
|
+
disabled: observable,
|
|
1217
|
+
});
|
|
1218
|
+
|
|
1219
|
+
return metamodel;
|
|
1220
|
+
};
|
|
1221
|
+
|
|
1222
|
+
export const observe_RelationalQueryGenerationConfig = (
|
|
1223
|
+
metamodel: RelationalQueryGenerationConfig,
|
|
1224
|
+
): RelationalQueryGenerationConfig => {
|
|
1225
|
+
if (metamodel instanceof GenerationFeaturesConfig) {
|
|
1226
|
+
return observe_GenerationFeaturesConfig(metamodel);
|
|
1227
|
+
}
|
|
1228
|
+
return metamodel;
|
|
1229
|
+
};
|
|
1230
|
+
|
|
1197
1231
|
const observe_Abstract_DatabaseConnection = (
|
|
1198
1232
|
metamodel: DatabaseConnection,
|
|
1199
1233
|
): void => {
|
|
@@ -1204,6 +1238,11 @@ const observe_Abstract_DatabaseConnection = (
|
|
|
1204
1238
|
timeZone: observable,
|
|
1205
1239
|
quoteIdentifiers: observable,
|
|
1206
1240
|
queryTimeOutInSeconds: observable,
|
|
1241
|
+
queryGenerationConfigs: observable,
|
|
1242
|
+
});
|
|
1243
|
+
|
|
1244
|
+
metamodel.queryGenerationConfigs.forEach((config) => {
|
|
1245
|
+
observe_RelationalQueryGenerationConfig(config);
|
|
1207
1246
|
});
|
|
1208
1247
|
};
|
|
1209
1248
|
|
|
@@ -23,6 +23,7 @@ import {
|
|
|
23
23
|
import type { V1_DatasourceSpecification } from './V1_DatasourceSpecification.js';
|
|
24
24
|
import type { V1_AuthenticationStrategy } from './V1_AuthenticationStrategy.js';
|
|
25
25
|
import type { V1_PostProcessor } from './postprocessor/V1_PostProcessor.js';
|
|
26
|
+
import type { V1_RelationalQueryGenerationConfig } from './V1_RelationalQueryGenerationConfig.js';
|
|
26
27
|
|
|
27
28
|
/**
|
|
28
29
|
* TODO: to be modularized or handled differently
|
|
@@ -59,6 +60,7 @@ export abstract class V1_DatabaseConnection extends V1_Connection {
|
|
|
59
60
|
quoteIdentifiers?: boolean | undefined;
|
|
60
61
|
queryTimeOutInSeconds?: number | undefined;
|
|
61
62
|
postProcessorWithParameter: unknown[] = [];
|
|
63
|
+
queryGenerationConfigs: V1_RelationalQueryGenerationConfig[] = [];
|
|
62
64
|
}
|
|
63
65
|
|
|
64
66
|
export class V1_RelationalDatabaseConnection
|
|
@@ -86,6 +88,7 @@ export class V1_RelationalDatabaseConnection
|
|
|
86
88
|
this.localMode?.toString() ?? '',
|
|
87
89
|
this.queryTimeOutInSeconds?.toString() ?? '',
|
|
88
90
|
hashArray(this.postProcessors),
|
|
91
|
+
hashArray(this.queryGenerationConfigs),
|
|
89
92
|
]);
|
|
90
93
|
}
|
|
91
94
|
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2020-present, Goldman Sachs
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
|
|
17
|
+
import { CORE_HASH_STRUCTURE } from '../../../../../../../../../graph/Core_HashUtils.js';
|
|
18
|
+
import { type Hashable, hashArray } from '@finos/legend-shared';
|
|
19
|
+
|
|
20
|
+
export abstract class V1_RelationalQueryGenerationConfig implements Hashable {
|
|
21
|
+
abstract get hashCode(): string;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export class V1_GenerationFeaturesConfig
|
|
25
|
+
extends V1_RelationalQueryGenerationConfig
|
|
26
|
+
implements Hashable
|
|
27
|
+
{
|
|
28
|
+
enabled: string[] = [];
|
|
29
|
+
disabled: string[] = [];
|
|
30
|
+
|
|
31
|
+
get hashCode(): string {
|
|
32
|
+
return hashArray([
|
|
33
|
+
CORE_HASH_STRUCTURE.GENERATION_FEATURES_CONFIG,
|
|
34
|
+
hashArray(this.enabled),
|
|
35
|
+
hashArray(this.disabled),
|
|
36
|
+
]);
|
|
37
|
+
}
|
|
38
|
+
}
|
package/src/graph-manager/protocol/pure/v1/transformation/pureGraph/from/V1_ConnectionTransformer.ts
CHANGED
|
@@ -99,6 +99,7 @@ import { INTERNAL__UnknownDatasourceSpecification } from '../../../../../../../g
|
|
|
99
99
|
import { INTERNAL__UnknownAuthenticationStrategy } from '../../../../../../../graph/metamodel/pure/packageableElements/store/relational/connection/INTERNAL__UnknownAuthenticationStrategy.js';
|
|
100
100
|
import { V1_INTERNAL__UnknownDatasourceSpecification } from '../../../model/packageableElements/store/relational/connection/V1_INTERNAL__UnknownDatasourceSpecification.js';
|
|
101
101
|
import { V1_INTERNAL__UnknownAuthenticationStrategy } from '../../../model/packageableElements/store/relational/connection/V1_INTERNAL__UnknownAuthenticationStrategy.js';
|
|
102
|
+
import { V1_transformQueryGenerationConfig } from './V1_QueryGenerationConfigTransformer.js';
|
|
102
103
|
|
|
103
104
|
const transformStaticDatasourceSpecification = (
|
|
104
105
|
metamodel: StaticDatasourceSpecification,
|
|
@@ -369,6 +370,11 @@ export const V1_transformRelationalDatabaseConnection = (
|
|
|
369
370
|
V1_transformPostProcessor(postprocessor, context),
|
|
370
371
|
);
|
|
371
372
|
}
|
|
373
|
+
if (metamodel.queryGenerationConfigs.length) {
|
|
374
|
+
connection.queryGenerationConfigs = metamodel.queryGenerationConfigs.map(
|
|
375
|
+
(config) => V1_transformQueryGenerationConfig(config, context),
|
|
376
|
+
);
|
|
377
|
+
}
|
|
372
378
|
return connection;
|
|
373
379
|
};
|
|
374
380
|
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2020-present, Goldman Sachs
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
|
|
17
|
+
import { UnsupportedOperationError } from '@finos/legend-shared';
|
|
18
|
+
import {
|
|
19
|
+
type RelationalQueryGenerationConfig,
|
|
20
|
+
GenerationFeaturesConfig,
|
|
21
|
+
} from '../../../../../../../graph/metamodel/pure/packageableElements/store/relational/connection/RelationalQueryGenerationConfig.js';
|
|
22
|
+
import {
|
|
23
|
+
type V1_RelationalQueryGenerationConfig,
|
|
24
|
+
V1_GenerationFeaturesConfig,
|
|
25
|
+
} from '../../../model/packageableElements/store/relational/connection/V1_RelationalQueryGenerationConfig.js';
|
|
26
|
+
import type { V1_GraphTransformerContext } from './V1_GraphTransformerContext.js';
|
|
27
|
+
|
|
28
|
+
export const V1_transformQueryGenerationConfig = (
|
|
29
|
+
metamodel: RelationalQueryGenerationConfig,
|
|
30
|
+
context: V1_GraphTransformerContext,
|
|
31
|
+
): V1_RelationalQueryGenerationConfig => {
|
|
32
|
+
if (metamodel instanceof GenerationFeaturesConfig) {
|
|
33
|
+
const protocol = new V1_GenerationFeaturesConfig();
|
|
34
|
+
protocol.enabled = metamodel.enabled;
|
|
35
|
+
protocol.disabled = metamodel.disabled;
|
|
36
|
+
return protocol;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
throw new UnsupportedOperationError(
|
|
40
|
+
`Can't transform query generation config: no compatible transformer available`,
|
|
41
|
+
metamodel,
|
|
42
|
+
);
|
|
43
|
+
};
|
|
@@ -60,6 +60,7 @@ import type { V1_ModelChainConnection } from '../../../../model/packageableEleme
|
|
|
60
60
|
import { V1_buildPostProcessor } from './V1_PostProcessorBuilderHelper.js';
|
|
61
61
|
import type { V1_INTERNAL__UnknownConnection } from '../../../../model/packageableElements/connection/V1_INTERNAL__UnknownConnection.js';
|
|
62
62
|
import { INTERNAL__UnknownConnection } from '../../../../../../../../graph/metamodel/pure/packageableElements/connection/INTERNAL__UnknownConnection.js';
|
|
63
|
+
import { V1_buildQueryGenerationConfig } from './V1_QueryGenerationConfigBuilderHelper.js';
|
|
63
64
|
|
|
64
65
|
class V1_ConnectionBuilder implements V1_ConnectionVisitor<Connection> {
|
|
65
66
|
context: V1_GraphBuilderContext;
|
|
@@ -293,6 +294,9 @@ class V1_ConnectionBuilder implements V1_ConnectionVisitor<Connection> {
|
|
|
293
294
|
V1_buildPostProcessor(p, this.context),
|
|
294
295
|
);
|
|
295
296
|
val.postProcessorWithParameter = connection.postProcessorWithParameter;
|
|
297
|
+
val.queryGenerationConfigs = connection.queryGenerationConfigs.map(
|
|
298
|
+
(config) => V1_buildQueryGenerationConfig(config, this.context),
|
|
299
|
+
);
|
|
296
300
|
return val;
|
|
297
301
|
}
|
|
298
302
|
}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2020-present, Goldman Sachs
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
|
|
17
|
+
import { UnsupportedOperationError } from '@finos/legend-shared';
|
|
18
|
+
import {
|
|
19
|
+
type RelationalQueryGenerationConfig,
|
|
20
|
+
GenerationFeaturesConfig,
|
|
21
|
+
} from '../../../../../../../../graph/metamodel/pure/packageableElements/store/relational/connection/RelationalQueryGenerationConfig.js';
|
|
22
|
+
import {
|
|
23
|
+
type V1_RelationalQueryGenerationConfig,
|
|
24
|
+
V1_GenerationFeaturesConfig,
|
|
25
|
+
} from '../../../../model/packageableElements/store/relational/connection/V1_RelationalQueryGenerationConfig.js';
|
|
26
|
+
import type { V1_GraphBuilderContext } from '../V1_GraphBuilderContext.js';
|
|
27
|
+
|
|
28
|
+
export const V1_buildQueryGenerationConfig = (
|
|
29
|
+
protocol: V1_RelationalQueryGenerationConfig,
|
|
30
|
+
context: V1_GraphBuilderContext,
|
|
31
|
+
): RelationalQueryGenerationConfig => {
|
|
32
|
+
if (protocol instanceof V1_GenerationFeaturesConfig) {
|
|
33
|
+
const metamodel = new GenerationFeaturesConfig();
|
|
34
|
+
metamodel.enabled = protocol.enabled;
|
|
35
|
+
metamodel.disabled = protocol.disabled;
|
|
36
|
+
return metamodel;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
throw new UnsupportedOperationError(
|
|
40
|
+
`Can't build query generation config: no compatible builder available`,
|
|
41
|
+
protocol,
|
|
42
|
+
);
|
|
43
|
+
};
|
|
@@ -81,6 +81,7 @@ import {
|
|
|
81
81
|
V1_deserializeMilestoning,
|
|
82
82
|
V1_serializeMilestoning,
|
|
83
83
|
} from './V1_MilestoningSerializationHelper.js';
|
|
84
|
+
import type { V1_RelationalQueryGenerationConfig } from '../../../model/packageableElements/store/relational/connection/V1_RelationalQueryGenerationConfig.js';
|
|
84
85
|
import type { V1_Milestoning } from '../../../model/packageableElements/store/relational/model/milestoning/V1_Milestoning.js';
|
|
85
86
|
import type { PureProtocolProcessorPlugin } from '../../../../PureProtocolProcessorPlugin.js';
|
|
86
87
|
import { V1_RelationalDatabaseConnection } from '../../../model/packageableElements/store/relational/connection/V1_RelationalDatabaseConnection.js';
|
|
@@ -105,6 +106,10 @@ import {
|
|
|
105
106
|
} from './V1_CoreSerializationHelper.js';
|
|
106
107
|
import { PackageableElementPointerType } from '../../../../../../../graph/MetaModelConst.js';
|
|
107
108
|
import { V1_TabularFunction } from '../../../model/packageableElements/store/relational/model/V1_TabularFunction.js';
|
|
109
|
+
import {
|
|
110
|
+
V1_serializeQueryGenerationConfig,
|
|
111
|
+
V1_deserializeQueryGenerationConfig,
|
|
112
|
+
} from './V1_QueryGenerationConfigSerializationHelper.js';
|
|
108
113
|
|
|
109
114
|
export const V1_DATABASE_ELEMENT_PROTOCOL_TYPE = 'relational';
|
|
110
115
|
|
|
@@ -582,6 +587,11 @@ const V1_setupRelationalDatabaseConnectionModelSchema = (
|
|
|
582
587
|
postProcessorWithParameter: customEquivalentList({
|
|
583
588
|
INTERNAL__forceReturnEmptyInTest: true,
|
|
584
589
|
}),
|
|
590
|
+
queryGenerationConfigs: customList(
|
|
591
|
+
(value: V1_RelationalQueryGenerationConfig) =>
|
|
592
|
+
V1_serializeQueryGenerationConfig(value, plugins),
|
|
593
|
+
(value) => V1_deserializeQueryGenerationConfig(value, plugins),
|
|
594
|
+
),
|
|
585
595
|
type: primitive(),
|
|
586
596
|
});
|
|
587
597
|
};
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2020-present, Goldman Sachs
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
|
|
17
|
+
import {
|
|
18
|
+
type V1_RelationalQueryGenerationConfig,
|
|
19
|
+
V1_GenerationFeaturesConfig,
|
|
20
|
+
} from '../../../model/packageableElements/store/relational/connection/V1_RelationalQueryGenerationConfig.js';
|
|
21
|
+
import {
|
|
22
|
+
createModelSchema,
|
|
23
|
+
deserialize,
|
|
24
|
+
serialize,
|
|
25
|
+
primitive,
|
|
26
|
+
list,
|
|
27
|
+
} from 'serializr';
|
|
28
|
+
import {
|
|
29
|
+
type PlainObject,
|
|
30
|
+
usingConstantValueSchema,
|
|
31
|
+
UnsupportedOperationError,
|
|
32
|
+
} from '@finos/legend-shared';
|
|
33
|
+
import type { PureProtocolProcessorPlugin } from '../../../../PureProtocolProcessorPlugin.js';
|
|
34
|
+
|
|
35
|
+
enum V1_QueryGenerationConfigType {
|
|
36
|
+
GENERATION_FEATURES = 'generationFeaturesConfig',
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
const V1_generationFeaturesConfigModelSchema = createModelSchema(
|
|
40
|
+
V1_GenerationFeaturesConfig,
|
|
41
|
+
{
|
|
42
|
+
_type: usingConstantValueSchema(
|
|
43
|
+
V1_QueryGenerationConfigType.GENERATION_FEATURES,
|
|
44
|
+
),
|
|
45
|
+
disabled: list(primitive()),
|
|
46
|
+
enabled: list(primitive()),
|
|
47
|
+
},
|
|
48
|
+
);
|
|
49
|
+
|
|
50
|
+
export const V1_serializeQueryGenerationConfig = (
|
|
51
|
+
value: V1_RelationalQueryGenerationConfig,
|
|
52
|
+
plugins: PureProtocolProcessorPlugin[],
|
|
53
|
+
): PlainObject<V1_RelationalQueryGenerationConfig> => {
|
|
54
|
+
if (value instanceof V1_GenerationFeaturesConfig) {
|
|
55
|
+
return serialize(V1_generationFeaturesConfigModelSchema, value);
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
throw new UnsupportedOperationError(
|
|
59
|
+
`Can't serialize query generation config: no compatible serializer available`,
|
|
60
|
+
value,
|
|
61
|
+
);
|
|
62
|
+
};
|
|
63
|
+
|
|
64
|
+
export const V1_deserializeQueryGenerationConfig = (
|
|
65
|
+
json: PlainObject<V1_RelationalQueryGenerationConfig>,
|
|
66
|
+
plugins: PureProtocolProcessorPlugin[],
|
|
67
|
+
): V1_RelationalQueryGenerationConfig => {
|
|
68
|
+
switch (json._type) {
|
|
69
|
+
case V1_QueryGenerationConfigType.GENERATION_FEATURES:
|
|
70
|
+
return deserialize(V1_generationFeaturesConfigModelSchema, json);
|
|
71
|
+
default: {
|
|
72
|
+
throw new UnsupportedOperationError(
|
|
73
|
+
`Can't deserialize query generation config of type '${json._type}'`,
|
|
74
|
+
);
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
};
|
package/tsconfig.json
CHANGED
|
@@ -288,6 +288,7 @@
|
|
|
288
288
|
"./src/graph/metamodel/pure/packageableElements/store/relational/connection/INTERNAL__UnknownAuthenticationStrategy.ts",
|
|
289
289
|
"./src/graph/metamodel/pure/packageableElements/store/relational/connection/INTERNAL__UnknownDatasourceSpecification.ts",
|
|
290
290
|
"./src/graph/metamodel/pure/packageableElements/store/relational/connection/RelationalDatabaseConnection.ts",
|
|
291
|
+
"./src/graph/metamodel/pure/packageableElements/store/relational/connection/RelationalQueryGenerationConfig.ts",
|
|
291
292
|
"./src/graph/metamodel/pure/packageableElements/store/relational/connection/postprocessor/INTERNAL__UnknownPostProcessor.ts",
|
|
292
293
|
"./src/graph/metamodel/pure/packageableElements/store/relational/connection/postprocessor/Mapper.ts",
|
|
293
294
|
"./src/graph/metamodel/pure/packageableElements/store/relational/connection/postprocessor/MapperPostProcessor.ts",
|
|
@@ -650,6 +651,7 @@
|
|
|
650
651
|
"./src/graph-manager/protocol/pure/v1/model/packageableElements/store/relational/connection/V1_INTERNAL__UnknownAuthenticationStrategy.ts",
|
|
651
652
|
"./src/graph-manager/protocol/pure/v1/model/packageableElements/store/relational/connection/V1_INTERNAL__UnknownDatasourceSpecification.ts",
|
|
652
653
|
"./src/graph-manager/protocol/pure/v1/model/packageableElements/store/relational/connection/V1_RelationalDatabaseConnection.ts",
|
|
654
|
+
"./src/graph-manager/protocol/pure/v1/model/packageableElements/store/relational/connection/V1_RelationalQueryGenerationConfig.ts",
|
|
653
655
|
"./src/graph-manager/protocol/pure/v1/model/packageableElements/store/relational/connection/postprocessor/V1_INTERNAL__UnknownPostProcessor.ts",
|
|
654
656
|
"./src/graph-manager/protocol/pure/v1/model/packageableElements/store/relational/connection/postprocessor/V1_Mapper.ts",
|
|
655
657
|
"./src/graph-manager/protocol/pure/v1/model/packageableElements/store/relational/connection/postprocessor/V1_MapperPostProcessor.ts",
|
|
@@ -775,6 +777,7 @@
|
|
|
775
777
|
"./src/graph-manager/protocol/pure/v1/transformation/pureGraph/from/V1_MilestoningTransformer.ts",
|
|
776
778
|
"./src/graph-manager/protocol/pure/v1/transformation/pureGraph/from/V1_PackageableElementTransformer.ts",
|
|
777
779
|
"./src/graph-manager/protocol/pure/v1/transformation/pureGraph/from/V1_PostProcessorTransformer.ts",
|
|
780
|
+
"./src/graph-manager/protocol/pure/v1/transformation/pureGraph/from/V1_QueryGenerationConfigTransformer.ts",
|
|
778
781
|
"./src/graph-manager/protocol/pure/v1/transformation/pureGraph/from/V1_RawValueSpecificationTransformer.ts",
|
|
779
782
|
"./src/graph-manager/protocol/pure/v1/transformation/pureGraph/from/V1_RuntimeTransformer.ts",
|
|
780
783
|
"./src/graph-manager/protocol/pure/v1/transformation/pureGraph/from/V1_SectionIndexTransformer.ts",
|
|
@@ -814,6 +817,7 @@
|
|
|
814
817
|
"./src/graph-manager/protocol/pure/v1/transformation/pureGraph/to/helpers/V1_MilestoningBuilderHelper.ts",
|
|
815
818
|
"./src/graph-manager/protocol/pure/v1/transformation/pureGraph/to/helpers/V1_PostProcessorBuilderHelper.ts",
|
|
816
819
|
"./src/graph-manager/protocol/pure/v1/transformation/pureGraph/to/helpers/V1_ProcessingContext.ts",
|
|
820
|
+
"./src/graph-manager/protocol/pure/v1/transformation/pureGraph/to/helpers/V1_QueryGenerationConfigBuilderHelper.ts",
|
|
817
821
|
"./src/graph-manager/protocol/pure/v1/transformation/pureGraph/to/helpers/V1_RelationalClassMappingBuilderHelper.ts",
|
|
818
822
|
"./src/graph-manager/protocol/pure/v1/transformation/pureGraph/to/helpers/V1_RelationalConnectionBuilderHelper.ts",
|
|
819
823
|
"./src/graph-manager/protocol/pure/v1/transformation/pureGraph/to/helpers/V1_RelationalPropertyMappingBuilder.ts",
|
|
@@ -840,6 +844,7 @@
|
|
|
840
844
|
"./src/graph-manager/protocol/pure/v1/transformation/pureProtocol/serializationHelpers/V1_MappingSerializationHelper.ts",
|
|
841
845
|
"./src/graph-manager/protocol/pure/v1/transformation/pureProtocol/serializationHelpers/V1_MilestoningSerializationHelper.ts",
|
|
842
846
|
"./src/graph-manager/protocol/pure/v1/transformation/pureProtocol/serializationHelpers/V1_PostProcessorSerializationHelper.ts",
|
|
847
|
+
"./src/graph-manager/protocol/pure/v1/transformation/pureProtocol/serializationHelpers/V1_QueryGenerationConfigSerializationHelper.ts",
|
|
843
848
|
"./src/graph-manager/protocol/pure/v1/transformation/pureProtocol/serializationHelpers/V1_RawValueSpecificationSerializationHelper.ts",
|
|
844
849
|
"./src/graph-manager/protocol/pure/v1/transformation/pureProtocol/serializationHelpers/V1_RuntimeSerializationHelper.ts",
|
|
845
850
|
"./src/graph-manager/protocol/pure/v1/transformation/pureProtocol/serializationHelpers/V1_SectionIndexSerializationHelper.ts",
|