@itwin/ecschema-metadata 5.2.0-dev.2 → 5.2.0-dev.20
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/CHANGELOG.md +35 -1
- package/lib/cjs/Deserialization/JsonProps.d.ts +7 -2
- package/lib/cjs/Deserialization/JsonProps.d.ts.map +1 -1
- package/lib/cjs/Deserialization/JsonProps.js.map +1 -1
- package/lib/cjs/Formatting/FormatSetFormatsProvider.d.ts +37 -0
- package/lib/cjs/Formatting/FormatSetFormatsProvider.d.ts.map +1 -0
- package/lib/cjs/Formatting/FormatSetFormatsProvider.js +58 -0
- package/lib/cjs/Formatting/FormatSetFormatsProvider.js.map +1 -0
- package/lib/cjs/{SchemaFormatsProvider.d.ts → Formatting/SchemaFormatsProvider.d.ts} +1 -1
- package/lib/cjs/Formatting/SchemaFormatsProvider.d.ts.map +1 -0
- package/lib/cjs/{SchemaFormatsProvider.js → Formatting/SchemaFormatsProvider.js} +6 -6
- package/lib/cjs/Formatting/SchemaFormatsProvider.js.map +1 -0
- package/lib/cjs/IncrementalLoading/ECSqlSchemaLocater.d.ts +18 -24
- package/lib/cjs/IncrementalLoading/ECSqlSchemaLocater.d.ts.map +1 -1
- package/lib/cjs/IncrementalLoading/ECSqlSchemaLocater.js +52 -26
- package/lib/cjs/IncrementalLoading/ECSqlSchemaLocater.js.map +1 -1
- package/lib/cjs/IncrementalLoading/IncrementalSchemaLocater.d.ts +16 -3
- package/lib/cjs/IncrementalLoading/IncrementalSchemaLocater.d.ts.map +1 -1
- package/lib/cjs/IncrementalLoading/IncrementalSchemaLocater.js +5 -4
- package/lib/cjs/IncrementalLoading/IncrementalSchemaLocater.js.map +1 -1
- package/lib/cjs/IncrementalLoading/IncrementalSchemaReader.d.ts.map +1 -1
- package/lib/cjs/IncrementalLoading/IncrementalSchemaReader.js +2 -7
- package/lib/cjs/IncrementalLoading/IncrementalSchemaReader.js.map +1 -1
- package/lib/cjs/IncrementalLoading/SchemaItemParsers.d.ts +4 -4
- package/lib/cjs/IncrementalLoading/SchemaItemParsers.d.ts.map +1 -1
- package/lib/cjs/IncrementalLoading/SchemaItemParsers.js +16 -16
- package/lib/cjs/IncrementalLoading/SchemaItemParsers.js.map +1 -1
- package/lib/cjs/IncrementalLoading/SchemaItemQueries.js +3 -3
- package/lib/cjs/IncrementalLoading/SchemaItemQueries.js.map +1 -1
- package/lib/cjs/IncrementalLoading/SchemaParser.d.ts +10 -4
- package/lib/cjs/IncrementalLoading/SchemaParser.d.ts.map +1 -1
- package/lib/cjs/IncrementalLoading/SchemaParser.js +19 -19
- package/lib/cjs/IncrementalLoading/SchemaParser.js.map +1 -1
- package/lib/cjs/Metadata/EntityClass.js +1 -1
- package/lib/cjs/Metadata/EntityClass.js.map +1 -1
- package/lib/cjs/Metadata/KindOfQuantity.d.ts.map +1 -1
- package/lib/cjs/Metadata/KindOfQuantity.js +9 -22
- package/lib/cjs/Metadata/KindOfQuantity.js.map +1 -1
- package/lib/cjs/ecschema-metadata.d.ts +2 -1
- package/lib/cjs/ecschema-metadata.d.ts.map +1 -1
- package/lib/cjs/ecschema-metadata.js +2 -1
- package/lib/cjs/ecschema-metadata.js.map +1 -1
- package/lib/esm/Deserialization/JsonProps.d.ts +7 -2
- package/lib/esm/Deserialization/JsonProps.d.ts.map +1 -1
- package/lib/esm/Deserialization/JsonProps.js.map +1 -1
- package/lib/esm/Formatting/FormatSetFormatsProvider.d.ts +37 -0
- package/lib/esm/Formatting/FormatSetFormatsProvider.d.ts.map +1 -0
- package/lib/esm/Formatting/FormatSetFormatsProvider.js +54 -0
- package/lib/esm/Formatting/FormatSetFormatsProvider.js.map +1 -0
- package/lib/esm/{SchemaFormatsProvider.d.ts → Formatting/SchemaFormatsProvider.d.ts} +1 -1
- package/lib/esm/Formatting/SchemaFormatsProvider.d.ts.map +1 -0
- package/lib/esm/{SchemaFormatsProvider.js → Formatting/SchemaFormatsProvider.js} +6 -6
- package/lib/esm/Formatting/SchemaFormatsProvider.js.map +1 -0
- package/lib/esm/IncrementalLoading/ECSqlSchemaLocater.d.ts +18 -24
- package/lib/esm/IncrementalLoading/ECSqlSchemaLocater.d.ts.map +1 -1
- package/lib/esm/IncrementalLoading/ECSqlSchemaLocater.js +51 -25
- package/lib/esm/IncrementalLoading/ECSqlSchemaLocater.js.map +1 -1
- package/lib/esm/IncrementalLoading/IncrementalSchemaLocater.d.ts +16 -3
- package/lib/esm/IncrementalLoading/IncrementalSchemaLocater.d.ts.map +1 -1
- package/lib/esm/IncrementalLoading/IncrementalSchemaLocater.js +5 -4
- package/lib/esm/IncrementalLoading/IncrementalSchemaLocater.js.map +1 -1
- package/lib/esm/IncrementalLoading/IncrementalSchemaReader.d.ts.map +1 -1
- package/lib/esm/IncrementalLoading/IncrementalSchemaReader.js +2 -7
- package/lib/esm/IncrementalLoading/IncrementalSchemaReader.js.map +1 -1
- package/lib/esm/IncrementalLoading/SchemaItemParsers.d.ts +4 -4
- package/lib/esm/IncrementalLoading/SchemaItemParsers.d.ts.map +1 -1
- package/lib/esm/IncrementalLoading/SchemaItemParsers.js +16 -16
- package/lib/esm/IncrementalLoading/SchemaItemParsers.js.map +1 -1
- package/lib/esm/IncrementalLoading/SchemaItemQueries.js +3 -3
- package/lib/esm/IncrementalLoading/SchemaItemQueries.js.map +1 -1
- package/lib/esm/IncrementalLoading/SchemaParser.d.ts +10 -4
- package/lib/esm/IncrementalLoading/SchemaParser.d.ts.map +1 -1
- package/lib/esm/IncrementalLoading/SchemaParser.js +19 -19
- package/lib/esm/IncrementalLoading/SchemaParser.js.map +1 -1
- package/lib/esm/Metadata/EntityClass.js +1 -1
- package/lib/esm/Metadata/EntityClass.js.map +1 -1
- package/lib/esm/Metadata/KindOfQuantity.d.ts.map +1 -1
- package/lib/esm/Metadata/KindOfQuantity.js +9 -22
- package/lib/esm/Metadata/KindOfQuantity.js.map +1 -1
- package/lib/esm/ecschema-metadata.d.ts +2 -1
- package/lib/esm/ecschema-metadata.d.ts.map +1 -1
- package/lib/esm/ecschema-metadata.js +2 -1
- package/lib/esm/ecschema-metadata.js.map +1 -1
- package/package.json +6 -6
- package/lib/cjs/IncrementalLoading/PerformanceLogger.d.ts +0 -60
- package/lib/cjs/IncrementalLoading/PerformanceLogger.d.ts.map +0 -1
- package/lib/cjs/IncrementalLoading/PerformanceLogger.js +0 -82
- package/lib/cjs/IncrementalLoading/PerformanceLogger.js.map +0 -1
- package/lib/cjs/SchemaFormatsProvider.d.ts.map +0 -1
- package/lib/cjs/SchemaFormatsProvider.js.map +0 -1
- package/lib/esm/IncrementalLoading/PerformanceLogger.d.ts +0 -60
- package/lib/esm/IncrementalLoading/PerformanceLogger.d.ts.map +0 -1
- package/lib/esm/IncrementalLoading/PerformanceLogger.js +0 -78
- package/lib/esm/IncrementalLoading/PerformanceLogger.js.map +0 -1
- package/lib/esm/SchemaFormatsProvider.d.ts.map +0 -1
- package/lib/esm/SchemaFormatsProvider.js.map +0 -1
|
@@ -3,7 +3,6 @@ import { ConstantProps, CustomAttributeClassProps, EntityClassProps, Enumeration
|
|
|
3
3
|
import { SchemaInfo } from "../Interfaces";
|
|
4
4
|
import { SchemaKey } from "../SchemaKey";
|
|
5
5
|
import { IncrementalSchemaLocater, SchemaLocaterOptions } from "./IncrementalSchemaLocater";
|
|
6
|
-
import { PerformanceLogger } from "./PerformanceLogger";
|
|
7
6
|
interface QueryParameters {
|
|
8
7
|
[parameterName: string]: string | number;
|
|
9
8
|
}
|
|
@@ -23,8 +22,6 @@ export interface ECSqlQueryOptions {
|
|
|
23
22
|
export interface ECSqlSchemaLocaterOptions extends SchemaLocaterOptions {
|
|
24
23
|
/** Query for Schemas using multiple queries. Defaults to false. */
|
|
25
24
|
readonly useMultipleQueries?: boolean;
|
|
26
|
-
/** Collects query execution performance data. Defaults to false. */
|
|
27
|
-
readonly performanceLogger?: PerformanceLogger;
|
|
28
25
|
}
|
|
29
26
|
/**
|
|
30
27
|
* An abstract [[IncrementalSchemaLocater]] implementation for loading
|
|
@@ -60,10 +57,7 @@ export declare abstract class ECSqlSchemaLocater extends IncrementalSchemaLocate
|
|
|
60
57
|
* @param context The [[SchemaContext]] to use for resolving references.
|
|
61
58
|
* @internal
|
|
62
59
|
*/
|
|
63
|
-
getSchemaJson(schemaKey: SchemaKey, context: SchemaContext): Promise<SchemaProps | undefined>;
|
|
64
|
-
/**
|
|
65
|
-
* Gets the [[SchemaProps]] without schemaItems.
|
|
66
|
-
*/
|
|
60
|
+
protected getSchemaJson(schemaKey: SchemaKey, context: SchemaContext): Promise<SchemaProps | undefined>;
|
|
67
61
|
/**
|
|
68
62
|
* Gets the [[SchemaProps]] without schemaItems for the given schema name.
|
|
69
63
|
* @param schemaName The name of the Schema.
|
|
@@ -71,7 +65,7 @@ export declare abstract class ECSqlSchemaLocater extends IncrementalSchemaLocate
|
|
|
71
65
|
* @returns
|
|
72
66
|
* @internal
|
|
73
67
|
*/
|
|
74
|
-
getSchemaNoItems
|
|
68
|
+
private getSchemaNoItems;
|
|
75
69
|
/**
|
|
76
70
|
* Checks if the [[SchemaContext]] has the right Meta Schema version to support the incremental schema loading.
|
|
77
71
|
* @param context The schema context to lookup the meta schema.
|
|
@@ -85,7 +79,7 @@ export declare abstract class ECSqlSchemaLocater extends IncrementalSchemaLocate
|
|
|
85
79
|
* @returns A promise that resolves to a EntityClassProps array. Maybe empty of no entities are found.
|
|
86
80
|
* @internal
|
|
87
81
|
*/
|
|
88
|
-
getEntities(schema: string, context: SchemaContext, queryOverride?: string): Promise<EntityClassProps[]>;
|
|
82
|
+
protected getEntities(schema: string, context: SchemaContext, queryOverride?: string): Promise<EntityClassProps[]>;
|
|
89
83
|
/**
|
|
90
84
|
* Gets all the Schema's Mixin classes as [[MixinProps]] JSON objects.
|
|
91
85
|
* @param schemaName The name of the Schema.
|
|
@@ -93,7 +87,7 @@ export declare abstract class ECSqlSchemaLocater extends IncrementalSchemaLocate
|
|
|
93
87
|
* @returns A promise that resolves to a MixinProps array. Maybe empty of no entities are found.
|
|
94
88
|
* @internal
|
|
95
89
|
*/
|
|
96
|
-
getMixins(schema: string, context: SchemaContext, queryOverride?: string): Promise<MixinProps[]>;
|
|
90
|
+
protected getMixins(schema: string, context: SchemaContext, queryOverride?: string): Promise<MixinProps[]>;
|
|
97
91
|
/**
|
|
98
92
|
* Gets all the Schema's Relationship classes as [[RelationshipClassProps]] JSON objects.
|
|
99
93
|
* @param schemaName The name of the Schema.
|
|
@@ -101,7 +95,7 @@ export declare abstract class ECSqlSchemaLocater extends IncrementalSchemaLocate
|
|
|
101
95
|
* @returns A promise that resolves to a RelationshipClassProps array. Maybe empty if no items are found.
|
|
102
96
|
* @internal
|
|
103
97
|
*/
|
|
104
|
-
getRelationships(schema: string, context: SchemaContext, queryOverride?: string): Promise<RelationshipClassProps[]>;
|
|
98
|
+
protected getRelationships(schema: string, context: SchemaContext, queryOverride?: string): Promise<RelationshipClassProps[]>;
|
|
105
99
|
/**
|
|
106
100
|
* Gets all the Schema's CustomAttributeClass items as [[CustomAttributeClassProps]] JSON objects.
|
|
107
101
|
* @param schemaName The name of the Schema.
|
|
@@ -109,7 +103,7 @@ export declare abstract class ECSqlSchemaLocater extends IncrementalSchemaLocate
|
|
|
109
103
|
* @returns A promise that resolves to a CustomAttributeClassProps array. Maybe empty if not items are found.
|
|
110
104
|
* @internal
|
|
111
105
|
*/
|
|
112
|
-
getCustomAttributeClasses(schema: string, context: SchemaContext, queryOverride?: string): Promise<CustomAttributeClassProps[]>;
|
|
106
|
+
protected getCustomAttributeClasses(schema: string, context: SchemaContext, queryOverride?: string): Promise<CustomAttributeClassProps[]>;
|
|
113
107
|
/**
|
|
114
108
|
* Gets all the Schema's StructClass items as [[StructClassProps]] JSON objects.
|
|
115
109
|
* @param schemaName The name of the Schema.
|
|
@@ -117,7 +111,7 @@ export declare abstract class ECSqlSchemaLocater extends IncrementalSchemaLocate
|
|
|
117
111
|
* @returns A promise that resolves to a StructClassProps array. Maybe empty if not items are found.
|
|
118
112
|
* @internal
|
|
119
113
|
*/
|
|
120
|
-
getStructs(schema: string, context: SchemaContext, queryOverride?: string): Promise<StructClassProps[]>;
|
|
114
|
+
protected getStructs(schema: string, context: SchemaContext, queryOverride?: string): Promise<StructClassProps[]>;
|
|
121
115
|
/**
|
|
122
116
|
* Gets all the Schema's KindOfQuantity items as [[KindOfQuantityProps]] JSON objects.
|
|
123
117
|
* @param schema The name of the Schema.
|
|
@@ -125,7 +119,7 @@ export declare abstract class ECSqlSchemaLocater extends IncrementalSchemaLocate
|
|
|
125
119
|
* @returns A promise that resolves to a KindOfQuantityProps array. Maybe empty if not items are found.
|
|
126
120
|
* @internal
|
|
127
121
|
*/
|
|
128
|
-
getKindOfQuantities(schema: string, context: SchemaContext): Promise<KindOfQuantityProps[]>;
|
|
122
|
+
protected getKindOfQuantities(schema: string, context: SchemaContext): Promise<KindOfQuantityProps[]>;
|
|
129
123
|
/**
|
|
130
124
|
* Gets all the Schema's PropertyCategory items as [[PropertyCategoryProps]] JSON objects.
|
|
131
125
|
* @param schema The name of the Schema.
|
|
@@ -133,7 +127,7 @@ export declare abstract class ECSqlSchemaLocater extends IncrementalSchemaLocate
|
|
|
133
127
|
* @returns A promise that resolves to a PropertyCategoryProps array. Maybe empty if not items are found.
|
|
134
128
|
* @internal
|
|
135
129
|
*/
|
|
136
|
-
getPropertyCategories(schema: string, context: SchemaContext): Promise<PropertyCategoryProps[]>;
|
|
130
|
+
protected getPropertyCategories(schema: string, context: SchemaContext): Promise<PropertyCategoryProps[]>;
|
|
137
131
|
/**
|
|
138
132
|
* Gets all the Schema's Enumeration items as [[EnumerationProps]] JSON objects.
|
|
139
133
|
* @param schema The name of the Schema.
|
|
@@ -141,7 +135,7 @@ export declare abstract class ECSqlSchemaLocater extends IncrementalSchemaLocate
|
|
|
141
135
|
* @returns A promise that resolves to a EnumerationProps array. Maybe empty if not items are found.
|
|
142
136
|
* @internal
|
|
143
137
|
*/
|
|
144
|
-
getEnumerations(schema: string, context: SchemaContext): Promise<EnumerationProps[]>;
|
|
138
|
+
protected getEnumerations(schema: string, context: SchemaContext): Promise<EnumerationProps[]>;
|
|
145
139
|
/**
|
|
146
140
|
* Gets all the Schema's Unit items as [[SchemaItemUnitProps]] JSON objects.
|
|
147
141
|
* @param schema The name of the Schema.
|
|
@@ -149,7 +143,7 @@ export declare abstract class ECSqlSchemaLocater extends IncrementalSchemaLocate
|
|
|
149
143
|
* @returns A promise that resolves to a SchemaItemUnitProps array. Maybe empty if not items are found.
|
|
150
144
|
* @internal
|
|
151
145
|
*/
|
|
152
|
-
getUnits(schema: string, context: SchemaContext): Promise<SchemaItemUnitProps[]>;
|
|
146
|
+
protected getUnits(schema: string, context: SchemaContext): Promise<SchemaItemUnitProps[]>;
|
|
153
147
|
/**
|
|
154
148
|
* Gets all the Schema's InvertedUnit items as [[InvertedUnitProps]] JSON objects.
|
|
155
149
|
* @param schema The name of the Schema.
|
|
@@ -157,7 +151,7 @@ export declare abstract class ECSqlSchemaLocater extends IncrementalSchemaLocate
|
|
|
157
151
|
* @returns A promise that resolves to a InvertedUnitProps array. Maybe empty if not items are found.
|
|
158
152
|
* @internal
|
|
159
153
|
*/
|
|
160
|
-
getInvertedUnits(schema: string, context: SchemaContext): Promise<InvertedUnitProps[]>;
|
|
154
|
+
protected getInvertedUnits(schema: string, context: SchemaContext): Promise<InvertedUnitProps[]>;
|
|
161
155
|
/**
|
|
162
156
|
* Gets all the Schema's Constant items as [[ConstantProps]] JSON objects.
|
|
163
157
|
* @param schema The name of the Schema.
|
|
@@ -165,7 +159,7 @@ export declare abstract class ECSqlSchemaLocater extends IncrementalSchemaLocate
|
|
|
165
159
|
* @returns A promise that resolves to a ConstantProps array. Maybe empty if not items are found.
|
|
166
160
|
* @internal
|
|
167
161
|
*/
|
|
168
|
-
getConstants(schema: string, context: SchemaContext): Promise<ConstantProps[]>;
|
|
162
|
+
protected getConstants(schema: string, context: SchemaContext): Promise<ConstantProps[]>;
|
|
169
163
|
/**
|
|
170
164
|
* Gets all the Schema's UnitSystem items as [[UnitSystemProps]] JSON objects.
|
|
171
165
|
* @param schema The name of the Schema.
|
|
@@ -173,7 +167,7 @@ export declare abstract class ECSqlSchemaLocater extends IncrementalSchemaLocate
|
|
|
173
167
|
* @returns A promise that resolves to a UnitSystemProps array. Maybe empty if not items are found.
|
|
174
168
|
* @internal
|
|
175
169
|
*/
|
|
176
|
-
getUnitSystems(schema: string, context: SchemaContext): Promise<UnitSystemProps[]>;
|
|
170
|
+
protected getUnitSystems(schema: string, context: SchemaContext): Promise<UnitSystemProps[]>;
|
|
177
171
|
/**
|
|
178
172
|
* Gets all the Schema's Phenomenon items as [[PhenomenonProps]] JSON objects.
|
|
179
173
|
* @param schema The name of the Schema.
|
|
@@ -181,7 +175,7 @@ export declare abstract class ECSqlSchemaLocater extends IncrementalSchemaLocate
|
|
|
181
175
|
* @returns A promise that resolves to a PhenomenonProps array. Maybe empty if not items are found.
|
|
182
176
|
* @internal
|
|
183
177
|
*/
|
|
184
|
-
getPhenomenon(schema: string, context: SchemaContext): Promise<PhenomenonProps[]>;
|
|
178
|
+
protected getPhenomenon(schema: string, context: SchemaContext): Promise<PhenomenonProps[]>;
|
|
185
179
|
/**
|
|
186
180
|
* Gets all the Schema's Format items as [[SchemaItemFormatProps]] JSON objects.
|
|
187
181
|
* @param schema The name of the Schema.
|
|
@@ -189,12 +183,12 @@ export declare abstract class ECSqlSchemaLocater extends IncrementalSchemaLocate
|
|
|
189
183
|
* @returns A promise that resolves to a SchemaItemFormatProps array. Maybe empty if not items are found.
|
|
190
184
|
* @internal
|
|
191
185
|
*/
|
|
192
|
-
getFormats(schema: string, context: SchemaContext): Promise<SchemaItemFormatProps[]>;
|
|
186
|
+
protected getFormats(schema: string, context: SchemaContext): Promise<SchemaItemFormatProps[]>;
|
|
193
187
|
/**
|
|
194
188
|
* Gets [[SchemaInfo]] objects for all schemas including their direct schema references.
|
|
195
189
|
* @internal
|
|
196
190
|
*/
|
|
197
|
-
loadSchemaInfos(): Promise<ReadonlyArray<SchemaInfo>>;
|
|
191
|
+
protected loadSchemaInfos(): Promise<ReadonlyArray<SchemaInfo>>;
|
|
198
192
|
/**
|
|
199
193
|
* Gets the [[SchemaProps]] to create the basic schema skeleton. Depending on which options are set, the schema items or class hierarchy
|
|
200
194
|
* can be included in the initial fetch.
|
|
@@ -202,7 +196,7 @@ export declare abstract class ECSqlSchemaLocater extends IncrementalSchemaLocate
|
|
|
202
196
|
* @returns A promise that resolves to the schema partials, which is an array of [[SchemaProps]].
|
|
203
197
|
* @internal
|
|
204
198
|
*/
|
|
205
|
-
getSchemaPartials(schemaKey: SchemaKey, context: SchemaContext): Promise<ReadonlyArray<SchemaProps> | undefined>;
|
|
199
|
+
protected getSchemaPartials(schemaKey: SchemaKey, context: SchemaContext): Promise<ReadonlyArray<SchemaProps> | undefined>;
|
|
206
200
|
private querySchemaItem;
|
|
207
201
|
private getFullSchema;
|
|
208
202
|
private getFullSchemaMultipleQueries;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ECSqlSchemaLocater.d.ts","sourceRoot":"","sources":["../../../src/IncrementalLoading/ECSqlSchemaLocater.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAC3C,OAAO,EAAE,aAAa,EAAE,yBAAyB,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,mBAAmB,EAAE,UAAU,EACvI,eAAe,EAAE,qBAAqB,EAAE,sBAAsB,EAAE,qBAAqB,EAAmB,mBAAmB,EAAE,WAAW,EACxI,gBAAgB,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AAE1E,OAAO,EAAE,UAAU,EAAiB,MAAM,eAAe,CAAC;AAC1D,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAEzC,OAAO,EAAE,wBAAwB,EAAE,oBAAoB,EAAE,MAAM,4BAA4B,CAAC;
|
|
1
|
+
{"version":3,"file":"ECSqlSchemaLocater.d.ts","sourceRoot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full copyright notice.
|
|
4
4
|
*--------------------------------------------------------------------------------------------*/
|
|
5
|
-
import {
|
|
5
|
+
import { Logger } from "@itwin/core-bentley";
|
|
6
|
+
import { SchemaMatchType } from "../ECObjects";
|
|
6
7
|
import { SchemaKey } from "../SchemaKey";
|
|
7
8
|
import { FullSchemaQueries } from "./FullSchemaQueries";
|
|
8
9
|
import { IncrementalSchemaLocater } from "./IncrementalSchemaLocater";
|
|
9
10
|
import { SchemaItemQueries } from "./SchemaItemQueries";
|
|
10
11
|
import { SchemaParser } from "./SchemaParser";
|
|
11
12
|
import { ecsqlQueries } from "./SchemaStubQueries";
|
|
13
|
+
const LOGGER_CATEGORY = "IncrementalSchemaLoading.Performance";
|
|
12
14
|
/**
|
|
13
15
|
* An abstract [[IncrementalSchemaLocater]] implementation for loading
|
|
14
16
|
* EC [Schema] instances from an iModelDb using ECSql queries.
|
|
@@ -41,17 +43,19 @@ export class ECSqlSchemaLocater extends IncrementalSchemaLocater {
|
|
|
41
43
|
// to fetch the whole schema json.
|
|
42
44
|
if (!await this.supportPartialSchemaLoading(context))
|
|
43
45
|
return this.getSchemaProps(schemaKey);
|
|
44
|
-
const
|
|
46
|
+
const queryStart = Date.now();
|
|
45
47
|
const schemaProps = this.options.useMultipleQueries
|
|
46
48
|
? await this.getFullSchemaMultipleQueries(schemaKey, context)
|
|
47
49
|
: await this.getFullSchema(schemaKey, context);
|
|
48
|
-
|
|
50
|
+
const queryDuration = Date.now() - queryStart;
|
|
51
|
+
Logger.logTrace(LOGGER_CATEGORY, `Recieved SchemaProps for ${schemaKey.name} in ${queryDuration}ms`, {
|
|
52
|
+
schemaName: schemaKey.name,
|
|
53
|
+
queryMode: this.options.useMultipleQueries ? "parallel" : "single",
|
|
54
|
+
duration: queryDuration,
|
|
55
|
+
});
|
|
49
56
|
return schemaProps;
|
|
50
57
|
}
|
|
51
58
|
;
|
|
52
|
-
/**
|
|
53
|
-
* Gets the [[SchemaProps]] without schemaItems.
|
|
54
|
-
*/
|
|
55
59
|
/**
|
|
56
60
|
* Gets the [[SchemaProps]] without schemaItems for the given schema name.
|
|
57
61
|
* @param schemaName The name of the Schema.
|
|
@@ -65,7 +69,8 @@ export class ECSqlSchemaLocater extends IncrementalSchemaLocater {
|
|
|
65
69
|
if (schemaRow === undefined)
|
|
66
70
|
return undefined;
|
|
67
71
|
const schema = JSON.parse(schemaRow.schema);
|
|
68
|
-
|
|
72
|
+
const schemaInfos = await this._schemaInfoCache.getSchemasByContext(context) ?? [];
|
|
73
|
+
return SchemaParser.parse(schema, schemaInfos);
|
|
69
74
|
}
|
|
70
75
|
/**
|
|
71
76
|
* Checks if the [[SchemaContext]] has the right Meta Schema version to support the incremental schema loading.
|
|
@@ -243,10 +248,16 @@ export class ECSqlSchemaLocater extends IncrementalSchemaLocater {
|
|
|
243
248
|
* @internal
|
|
244
249
|
*/
|
|
245
250
|
async getSchemaPartials(schemaKey, context) {
|
|
251
|
+
const queryStart = Date.now();
|
|
246
252
|
const [schemaRow] = await this.executeQuery(ecsqlQueries.schemaStubQuery, {
|
|
247
253
|
parameters: { schemaName: schemaKey.name },
|
|
248
254
|
limit: 1
|
|
249
255
|
});
|
|
256
|
+
const queryDuration = Date.now() - queryStart;
|
|
257
|
+
Logger.logTrace(LOGGER_CATEGORY, `Recieved PartialSchema for ${schemaKey.name} in ${queryDuration}ms`, {
|
|
258
|
+
schemaName: schemaKey.name,
|
|
259
|
+
duration: queryDuration,
|
|
260
|
+
});
|
|
250
261
|
if (!schemaRow)
|
|
251
262
|
return undefined;
|
|
252
263
|
const schemaPartials = [];
|
|
@@ -267,11 +278,12 @@ export class ECSqlSchemaLocater extends IncrementalSchemaLocater {
|
|
|
267
278
|
if (!schemaStub) {
|
|
268
279
|
schemaStub = await addSchema(SchemaKey.parseString(`${schemaName}.0.0.0`));
|
|
269
280
|
}
|
|
270
|
-
|
|
271
|
-
|
|
281
|
+
let items = schemaStub.items;
|
|
282
|
+
if (!items) {
|
|
283
|
+
Object.assign(schemaStub, items = { items: {} });
|
|
272
284
|
}
|
|
273
|
-
const existingItem =
|
|
274
|
-
Object.assign(
|
|
285
|
+
const existingItem = items[itemInfo.name] || {};
|
|
286
|
+
Object.assign(items, { [itemInfo.name]: Object.assign(existingItem, itemInfo) });
|
|
275
287
|
};
|
|
276
288
|
const reviver = (_key, value) => {
|
|
277
289
|
if (value === null) {
|
|
@@ -280,19 +292,27 @@ export class ECSqlSchemaLocater extends IncrementalSchemaLocater {
|
|
|
280
292
|
return value;
|
|
281
293
|
};
|
|
282
294
|
await addSchema(schemaKey);
|
|
283
|
-
|
|
295
|
+
const schemaInfos = await this._schemaInfoCache.getSchemasByContext(context) ?? [];
|
|
296
|
+
await parseSchemaItemStubs(schemaKey.name, JSON.parse(schemaRow.items, reviver), addItems, schemaInfos);
|
|
284
297
|
return schemaPartials;
|
|
285
298
|
}
|
|
286
299
|
async querySchemaItem(context, schemaName, query, schemaType) {
|
|
287
300
|
const start = Date.now();
|
|
288
301
|
const itemRows = await this.executeQuery(query, { parameters: { schemaName } });
|
|
289
|
-
|
|
302
|
+
const queryDuration = Date.now() - start;
|
|
303
|
+
Logger.logTrace(LOGGER_CATEGORY, `Recieved rows of ${schemaType} items for ${schemaName} in ${queryDuration}ms`, {
|
|
304
|
+
schemaName,
|
|
305
|
+
itemCount: itemRows.length,
|
|
306
|
+
itemType: schemaType,
|
|
307
|
+
duration: queryDuration,
|
|
308
|
+
});
|
|
290
309
|
if (itemRows.length === 0)
|
|
291
310
|
return [];
|
|
292
311
|
const items = itemRows.map((itemRow) => {
|
|
293
312
|
return "string" === typeof itemRow.item ? JSON.parse(itemRow.item) : itemRow.item;
|
|
294
313
|
});
|
|
295
|
-
|
|
314
|
+
const schemaInfos = await this._schemaInfoCache.getSchemasByContext(context) ?? [];
|
|
315
|
+
return await SchemaParser.parseSchemaItems(items, schemaName, schemaInfos) ?? [];
|
|
296
316
|
}
|
|
297
317
|
async getFullSchema(schemaKey, context) {
|
|
298
318
|
const schemaRows = await this.executeQuery(FullSchemaQueries.schemaQuery, { parameters: { schemaName: schemaKey.name } });
|
|
@@ -304,13 +324,14 @@ export class ECSqlSchemaLocater extends IncrementalSchemaLocater {
|
|
|
304
324
|
if (schema.items) {
|
|
305
325
|
schema.items = schema.items.map((itemRow) => { return itemRow.item; });
|
|
306
326
|
}
|
|
307
|
-
|
|
327
|
+
const schemaInfos = await this._schemaInfoCache.getSchemasByContext(context) ?? [];
|
|
328
|
+
return SchemaParser.parse(schema, schemaInfos);
|
|
308
329
|
}
|
|
309
330
|
async getFullSchemaMultipleQueries(schemaKey, context) {
|
|
310
331
|
const schema = await this.getSchemaNoItems(schemaKey.name, context);
|
|
311
332
|
if (!schema)
|
|
312
333
|
return undefined;
|
|
313
|
-
schema.items = {};
|
|
334
|
+
const items = schema.items || (schema.items = {});
|
|
314
335
|
await Promise.all([
|
|
315
336
|
this.getEntities(schemaKey.name, context),
|
|
316
337
|
this.getMixins(schemaKey.name, context),
|
|
@@ -327,9 +348,14 @@ export class ECSqlSchemaLocater extends IncrementalSchemaLocater {
|
|
|
327
348
|
this.getPhenomenon(schemaKey.name, context),
|
|
328
349
|
this.getFormats(schemaKey.name, context)
|
|
329
350
|
]).then((itemResults) => {
|
|
330
|
-
const flatItemList = itemResults.reduce((acc,
|
|
351
|
+
const flatItemList = itemResults.reduce((acc, result) => acc.concat(result));
|
|
331
352
|
flatItemList.forEach((schemaItem) => {
|
|
332
|
-
|
|
353
|
+
if (!schemaItem.name) {
|
|
354
|
+
// This should never be happen, as we query the schema items by name from the database, but since the SchemaProps
|
|
355
|
+
// have name optional, we need the check here to make the compiler happy.
|
|
356
|
+
throw new Error(`SchemaItem with no name encountered in schema ${schemaKey.name}`);
|
|
357
|
+
}
|
|
358
|
+
items[schemaItem.name] = schemaItem;
|
|
333
359
|
});
|
|
334
360
|
});
|
|
335
361
|
return schema;
|
|
@@ -338,7 +364,7 @@ export class ECSqlSchemaLocater extends IncrementalSchemaLocater {
|
|
|
338
364
|
function parseSchemaReference(referenceName) {
|
|
339
365
|
return { schemaKey: SchemaKey.parseString(referenceName) };
|
|
340
366
|
}
|
|
341
|
-
async function parseSchemaItemStubs(schemaName,
|
|
367
|
+
async function parseSchemaItemStubs(schemaName, itemRows, addItemsHandler, schemaInfos) {
|
|
342
368
|
if (!itemRows || itemRows.length === 0) {
|
|
343
369
|
return;
|
|
344
370
|
}
|
|
@@ -349,32 +375,32 @@ async function parseSchemaItemStubs(schemaName, context, itemRows, addItemsHandl
|
|
|
349
375
|
const currentItem = baseClasses[index--];
|
|
350
376
|
const baseClassItem = baseClasses[index];
|
|
351
377
|
const baseClassName = baseClassItem ? `${baseClassItem.schema}.${baseClassItem.name}` : undefined;
|
|
352
|
-
const schemaItem = await SchemaParser.parseItem(currentItem, currentItem.schema,
|
|
378
|
+
const schemaItem = await SchemaParser.parseItem(currentItem, currentItem.schema, schemaInfos);
|
|
353
379
|
await addItemsHandler(currentItem.schema, {
|
|
354
380
|
...schemaItem,
|
|
355
381
|
name: schemaItem.name,
|
|
356
|
-
schemaItemType:
|
|
382
|
+
schemaItemType: schemaItem.schemaItemType,
|
|
357
383
|
baseClass: baseClassName,
|
|
358
384
|
});
|
|
359
385
|
}
|
|
360
386
|
};
|
|
361
387
|
for (const itemRow of itemRows) {
|
|
362
|
-
const schemaItem = await SchemaParser.parseItem(itemRow, schemaName,
|
|
388
|
+
const schemaItem = await SchemaParser.parseItem(itemRow, schemaName, schemaInfos);
|
|
363
389
|
await addItemsHandler(schemaName, {
|
|
364
390
|
...schemaItem,
|
|
365
391
|
name: schemaItem.name,
|
|
366
|
-
schemaItemType:
|
|
392
|
+
schemaItemType: schemaItem.schemaItemType,
|
|
367
393
|
mixins: itemRow.mixins
|
|
368
394
|
? itemRow.mixins.map(mixin => { return `${mixin.schema}.${mixin.name}`; })
|
|
369
395
|
: undefined,
|
|
370
396
|
});
|
|
371
397
|
await parseBaseClasses(itemRow.baseClasses);
|
|
372
398
|
for (const mixinRow of itemRow.mixins || []) {
|
|
373
|
-
const mixinItem = await SchemaParser.parseItem(mixinRow, mixinRow.schema,
|
|
399
|
+
const mixinItem = await SchemaParser.parseItem(mixinRow, mixinRow.schema, schemaInfos);
|
|
374
400
|
await addItemsHandler(mixinRow.schema, {
|
|
375
401
|
...mixinItem,
|
|
376
402
|
name: mixinItem.name,
|
|
377
|
-
schemaItemType:
|
|
403
|
+
schemaItemType: mixinItem.schemaItemType,
|
|
378
404
|
});
|
|
379
405
|
await parseBaseClasses(mixinRow.baseClasses);
|
|
380
406
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ECSqlSchemaLocater.js","sourceRoot":"","sources":["../../../src/IncrementalLoading/ECSqlSchemaLocater.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;AAMhG,OAAO,EAAE,mBAAmB,EAAkB,eAAe,EAAE,MAAM,cAAc,CAAC;AAEpF,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACzC,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,EAAE,wBAAwB,EAAwB,MAAM,4BAA4B,CAAC;AAE5F,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAoFnD;;;;GAIG;AACH,MAAM,OAAgB,kBAAmB,SAAQ,wBAAwB;IACvE;;OAEG;IACH,IAAuB,OAAO;QAC5B,OAAO,KAAK,CAAC,OAAoC,CAAC;IACpD,CAAC;IAED;;;OAGG;IACH,YAAY,OAAmC;QAC7C,KAAK,CAAC,OAAO,CAAC,CAAC;IACjB,CAAC;IAgBD;;;;;;OAMG;IACI,KAAK,CAAC,aAAa,CAAC,SAAoB,EAAE,OAAsB;QACrE,gHAAgH;QAChH,gHAAgH;QAChH,kCAAkC;QAClC,IAAI,CAAC,MAAM,IAAI,CAAC,2BAA2B,CAAC,OA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------------------------------------------------\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n * See LICENSE.md in the project root for license terms and full copyright notice.\n *--------------------------------------------------------------------------------------------*/\n\nimport { SchemaContext } from \"../Context\";\nimport { ConstantProps, CustomAttributeClassProps, EntityClassProps, EnumerationProps, InvertedUnitProps, KindOfQuantityProps, MixinProps,\n PhenomenonProps, PropertyCategoryProps, RelationshipClassProps, SchemaItemFormatProps, SchemaItemProps, SchemaItemUnitProps, SchemaProps,\n StructClassProps, UnitSystemProps } from \"../Deserialization/JsonProps\";\nimport { parseSchemaItemType, SchemaItemType, SchemaMatchType } from \"../ECObjects\";\nimport { SchemaInfo, WithSchemaKey } from \"../Interfaces\";\nimport { SchemaKey } from \"../SchemaKey\";\nimport { FullSchemaQueries } from \"./FullSchemaQueries\";\nimport { IncrementalSchemaLocater, SchemaLocaterOptions } from \"./IncrementalSchemaLocater\";\nimport { PerformanceLogger } from \"./PerformanceLogger\";\nimport { SchemaItemQueries } from \"./SchemaItemQueries\";\nimport { SchemaParser } from \"./SchemaParser\";\nimport { ecsqlQueries } from \"./SchemaStubQueries\";\n\ninterface SchemaItemInfo {\n readonly name: string;\n readonly schemaItemType: SchemaItemType;\n}\n\ninterface SchemaInfoRow {\n readonly name: string;\n readonly version: string;\n readonly alias: string;\n readonly references: string;\n}\n\ninterface SchemaStubRow {\n readonly name: string;\n readonly version: string;\n readonly alias: string;\n readonly displayLabel: string;\n readonly description: string;\n readonly references: string;\n readonly items: string;\n}\n\ninterface BaseClassStubRow {\n readonly schema: string;\n readonly name: string;\n readonly schemaItemType: string;\n readonly modifier: number;\n}\n\ninterface SchemaItemStubRow {\n readonly name: string;\n readonly schemaItemType: string;\n readonly modifier?: number;\n readonly baseClasses?: Array<BaseClassStubRow>;\n readonly mixins?: Array<{\n readonly schema: string,\n readonly name: string;\n readonly schemaItemType: string;\n readonly modifier: number;\n readonly baseClasses?: Array<BaseClassStubRow>\n }>;\n}\n\ninterface SchemaRow {\n schema: string\n}\n\ninterface SchemaItemRow {\n item: string | SchemaItemProps;\n}\n\ntype AddSchemaItemHandler = <T extends SchemaItemInfo>(schemaName: string, itemStub: T) => Promise<void>;\n\ntype MutableSchemaProps = {\n -readonly [K in keyof SchemaProps]: SchemaProps[K]\n};\n\ninterface QueryParameters {\n [parameterName: string]: string | number;\n}\n\n/**\n * Query options used by the ECSqlSchemaLocater.\n * @internal\n */\nexport interface ECSqlQueryOptions {\n parameters?: QueryParameters;\n limit?: number;\n}\n\n/**\n * Defines the [[ECSqlSchemaLocater]] options which determine how each\n * schema is to be loaded. All options are optional.\n * @internal\n */\nexport interface ECSqlSchemaLocaterOptions extends SchemaLocaterOptions {\n /** Query for Schemas using multiple queries. Defaults to false. */\n readonly useMultipleQueries?: boolean;\n /** Collects query execution performance data. Defaults to false. */\n readonly performanceLogger?: PerformanceLogger;\n}\n\n/**\n * An abstract [[IncrementalSchemaLocater]] implementation for loading\n * EC [Schema] instances from an iModelDb using ECSql queries.\n * @internal\n */\nexport abstract class ECSqlSchemaLocater extends IncrementalSchemaLocater {\n /**\n * Gets the [[ECSqlSchemaLocaterOptions]] used by this locater.\n */\n protected override get options(): ECSqlSchemaLocaterOptions {\n return super.options as ECSqlSchemaLocaterOptions;\n }\n\n /**\n * Initializes a new ECSqlSchemaLocater instance.\n * @param options The options used by this Schema locater.\n */\n constructor(options?: ECSqlSchemaLocaterOptions) {\n super(options);\n }\n\n /**\n * Executes the given ECSql query and returns the resulting rows.\n * @param query The ECSql query to execute.\n * @param options Optional arguments to control the query result.\n * @returns A promise that resolves to the resulting rows.\n */\n protected abstract executeQuery<TRow>(query: string, options?: ECSqlQueryOptions): Promise<ReadonlyArray<TRow>>;\n\n /**\n * Gets the [[SchemaProps]] for the given schema key.\n * @param schemaKey The schema key of the schema to be resolved.\n */\n protected abstract getSchemaProps(schemaKey: SchemaKey): Promise<SchemaProps | undefined>\n\n /**\n * Gets the [[SchemaProps]] for the given schema key. This is the full schema json with all elements that are defined\n * in the schema. The schema locater calls this after the stub has been loaded to fully load the schema in the background.\n * @param schemaKey The [[SchemaKey]] of the schema to be resolved.\n * @param context The [[SchemaContext]] to use for resolving references.\n * @internal\n */\n public async getSchemaJson(schemaKey: SchemaKey, context: SchemaContext): Promise<SchemaProps | undefined> {\n // If the meta schema is an earlier version than 4.0.3, we can't use the ECSql query interface to get the schema\n // information required to load the schema entirely. In this case, we fallback to use the ECSchema RPC interface\n // to fetch the whole schema json.\n if (!await this.supportPartialSchemaLoading(context))\n return this.getSchemaProps(schemaKey);\n\n const start = Date.now();\n const schemaProps = this.options.useMultipleQueries\n ? await this.getFullSchemaMultipleQueries(schemaKey, context)\n : await this.getFullSchema(schemaKey, context);\n\n this.options.performanceLogger?.logSchema(start, schemaKey.name);\n\n return schemaProps;\n };\n\n /**\n * Gets the [[SchemaProps]] without schemaItems.\n */\n /**\n * Gets the [[SchemaProps]] without schemaItems for the given schema name.\n * @param schemaName The name of the Schema.\n * @param context The [[SchemaContext]] to use for resolving references.\n * @returns\n * @internal\n */\n public async getSchemaNoItems(schemaName: string, context: SchemaContext): Promise<SchemaProps | undefined> {\n const schemaRows = await this.executeQuery<SchemaRow>(FullSchemaQueries.schemaNoItemsQuery, { parameters: { schemaName } });\n const schemaRow = schemaRows[0];\n if (schemaRow === undefined)\n return undefined;\n\n const schema = JSON.parse(schemaRow.schema) as SchemaProps;\n return SchemaParser.parse(schema, context);\n }\n\n /**\n * Checks if the [[SchemaContext]] has the right Meta Schema version to support the incremental schema loading.\n * @param context The schema context to lookup the meta schema.\n * @returns true if the context has a supported meta schema version, false otherwise.\n */\n protected async supportPartialSchemaLoading(context: SchemaContext): Promise<boolean> {\n const metaSchemaKey = new SchemaKey(\"ECDbMeta\", 4, 0, 3);\n const metaSchemaInfo = await context.getSchemaInfo(metaSchemaKey, SchemaMatchType.LatestWriteCompatible);\n return metaSchemaInfo !== undefined;\n };\n\n /**\n * Gets all the Schema's Entity classes as [[EntityClassProps]] JSON objects.\n * @param schemaName The name of the Schema.\n * @param context The [[SchemaContext]] to which the schema belongs.\n * @returns A promise that resolves to a EntityClassProps array. Maybe empty of no entities are found.\n * @internal\n */\n public async getEntities(schema: string, context: SchemaContext, queryOverride?: string): Promise<EntityClassProps[]> {\n const query = queryOverride ?? FullSchemaQueries.entityQuery;\n return this.querySchemaItem<EntityClassProps>(context, schema, query, \"EntityClass\");\n }\n\n /**\n * Gets all the Schema's Mixin classes as [[MixinProps]] JSON objects.\n * @param schemaName The name of the Schema.\n * @param context The SchemaContext to which the schema belongs.\n * @returns A promise that resolves to a MixinProps array. Maybe empty of no entities are found.\n * @internal\n */\n public async getMixins(schema: string, context: SchemaContext, queryOverride?: string): Promise<MixinProps[]> {\n const query = queryOverride ?? FullSchemaQueries.mixinQuery;\n return this.querySchemaItem<MixinProps>(context, schema, query, \"Mixin\");\n }\n\n /**\n * Gets all the Schema's Relationship classes as [[RelationshipClassProps]] JSON objects.\n * @param schemaName The name of the Schema.\n * @param context The SchemaContext to which the schema belongs.\n * @returns A promise that resolves to a RelationshipClassProps array. Maybe empty if no items are found.\n * @internal\n */\n public async getRelationships(schema: string, context: SchemaContext, queryOverride?: string): Promise<RelationshipClassProps[]> {\n const query = queryOverride ?? FullSchemaQueries.relationshipClassQuery;\n return this.querySchemaItem<RelationshipClassProps>(context, schema, query, \"RelationshipClass\");\n }\n\n /**\n * Gets all the Schema's CustomAttributeClass items as [[CustomAttributeClassProps]] JSON objects.\n * @param schemaName The name of the Schema.\n * @param context The SchemaContext to which the schema belongs.\n * @returns A promise that resolves to a CustomAttributeClassProps array. Maybe empty if not items are found.\n * @internal\n */\n public async getCustomAttributeClasses(schema: string, context: SchemaContext, queryOverride?: string): Promise<CustomAttributeClassProps[]> {\n const query = queryOverride ?? FullSchemaQueries.customAttributeQuery;\n return this.querySchemaItem<CustomAttributeClassProps>(context, schema, query, \"CustomAttributeClass\");\n }\n\n\n /**\n * Gets all the Schema's StructClass items as [[StructClassProps]] JSON objects.\n * @param schemaName The name of the Schema.\n * @param context The SchemaContext to which the schema belongs.\n * @returns A promise that resolves to a StructClassProps array. Maybe empty if not items are found.\n * @internal\n */\n public async getStructs(schema: string, context: SchemaContext, queryOverride?: string): Promise<StructClassProps[]> {\n const query = queryOverride ?? FullSchemaQueries.structQuery;\n return this.querySchemaItem<StructClassProps>(context, schema, query, \"StructClass\");\n }\n\n /**\n * Gets all the Schema's KindOfQuantity items as [[KindOfQuantityProps]] JSON objects.\n * @param schema The name of the Schema.\n * @param context The SchemaContext to which the schema belongs.\n * @returns A promise that resolves to a KindOfQuantityProps array. Maybe empty if not items are found.\n * @internal\n */\n public async getKindOfQuantities(schema: string, context: SchemaContext): Promise<KindOfQuantityProps[]> {\n return this.querySchemaItem<KindOfQuantityProps>(context, schema, SchemaItemQueries.kindOfQuantity(true), \"KindOfQuantity\");\n }\n\n /**\n * Gets all the Schema's PropertyCategory items as [[PropertyCategoryProps]] JSON objects.\n * @param schema The name of the Schema.\n * @param context The SchemaContext to which the schema belongs.\n * @returns A promise that resolves to a PropertyCategoryProps array. Maybe empty if not items are found.\n * @internal\n */\n public async getPropertyCategories(schema: string, context: SchemaContext): Promise<PropertyCategoryProps[]> {\n return this.querySchemaItem<PropertyCategoryProps>(context, schema, SchemaItemQueries.propertyCategory(true), \"PropertyCategory\");\n }\n\n /**\n * Gets all the Schema's Enumeration items as [[EnumerationProps]] JSON objects.\n * @param schema The name of the Schema.\n * @param context The SchemaContext to which the schema belongs.\n * @returns A promise that resolves to a EnumerationProps array. Maybe empty if not items are found.\n * @internal\n */\n public async getEnumerations(schema: string, context: SchemaContext): Promise<EnumerationProps[]> {\n return this.querySchemaItem<EnumerationProps>(context, schema, SchemaItemQueries.enumeration(true), \"Enumeration\");\n }\n\n /**\n * Gets all the Schema's Unit items as [[SchemaItemUnitProps]] JSON objects.\n * @param schema The name of the Schema.\n * @param context The SchemaContext to which the schema belongs.\n * @returns A promise that resolves to a SchemaItemUnitProps array. Maybe empty if not items are found.\n * @internal\n */\n public async getUnits(schema: string, context: SchemaContext): Promise<SchemaItemUnitProps[]> {\n return this.querySchemaItem<SchemaItemUnitProps>(context, schema, SchemaItemQueries.unit(true), \"Unit\");\n }\n\n /**\n * Gets all the Schema's InvertedUnit items as [[InvertedUnitProps]] JSON objects.\n * @param schema The name of the Schema.\n * @param context The SchemaContext to which the schema belongs.\n * @returns A promise that resolves to a InvertedUnitProps array. Maybe empty if not items are found.\n * @internal\n */\n public async getInvertedUnits(schema: string, context: SchemaContext): Promise<InvertedUnitProps[]> {\n return this.querySchemaItem<InvertedUnitProps>(context, schema, SchemaItemQueries.invertedUnit(true), \"InvertedUnit\");\n }\n\n /**\n * Gets all the Schema's Constant items as [[ConstantProps]] JSON objects.\n * @param schema The name of the Schema.\n * @param context The SchemaContext to which the schema belongs.\n * @returns A promise that resolves to a ConstantProps array. Maybe empty if not items are found.\n * @internal\n */\n public async getConstants(schema: string, context: SchemaContext): Promise<ConstantProps[]> {\n return this.querySchemaItem<ConstantProps>(context, schema, SchemaItemQueries.constant(true), \"Constant\");\n }\n\n /**\n * Gets all the Schema's UnitSystem items as [[UnitSystemProps]] JSON objects.\n * @param schema The name of the Schema.\n * @param context The SchemaContext to which the schema belongs.\n * @returns A promise that resolves to a UnitSystemProps array. Maybe empty if not items are found.\n * @internal\n */\n public async getUnitSystems(schema: string, context: SchemaContext): Promise<UnitSystemProps[]> {\n return this.querySchemaItem<UnitSystemProps>(context, schema, SchemaItemQueries.unitSystem(true), \"UnitSystem\");\n }\n\n /**\n * Gets all the Schema's Phenomenon items as [[PhenomenonProps]] JSON objects.\n * @param schema The name of the Schema.\n * @param context The SchemaContext to which the schema belongs.\n * @returns A promise that resolves to a PhenomenonProps array. Maybe empty if not items are found.\n * @internal\n */\n public async getPhenomenon(schema: string, context: SchemaContext): Promise<PhenomenonProps[]> {\n return this.querySchemaItem<PhenomenonProps>(context, schema, SchemaItemQueries.phenomenon(true), \"Phenomenon\");\n }\n\n /**\n * Gets all the Schema's Format items as [[SchemaItemFormatProps]] JSON objects.\n * @param schema The name of the Schema.\n * @param context The SchemaContext to which the schema belongs.\n * @returns A promise that resolves to a SchemaItemFormatProps array. Maybe empty if not items are found.\n * @internal\n */\n public async getFormats(schema: string, context: SchemaContext): Promise<SchemaItemFormatProps[]> {\n return this.querySchemaItem<SchemaItemFormatProps>(context, schema, SchemaItemQueries.format(true), \"Format\");\n }\n\n /**\n * Gets [[SchemaInfo]] objects for all schemas including their direct schema references.\n * @internal\n */\n public async loadSchemaInfos(): Promise<ReadonlyArray<SchemaInfo>> {\n const schemaRows = await this.executeQuery<SchemaInfoRow>(ecsqlQueries.schemaInfoQuery);\n return schemaRows.map((schemaRow) => (\n {\n alias: schemaRow.alias,\n schemaKey: SchemaKey.parseString(`${schemaRow.name}.${schemaRow.version}`),\n references: Array.from(JSON.parse(schemaRow.references), parseSchemaReference),\n }\n ));\n }\n\n /**\n * Gets the [[SchemaProps]] to create the basic schema skeleton. Depending on which options are set, the schema items or class hierarchy\n * can be included in the initial fetch.\n * @param schemaKey The [[SchemaKey]] of the schema to be resolved.\n * @returns A promise that resolves to the schema partials, which is an array of [[SchemaProps]].\n * @internal\n */\n public async getSchemaPartials(schemaKey: SchemaKey, context: SchemaContext): Promise<ReadonlyArray<SchemaProps> | undefined> {\n const [schemaRow] = await this.executeQuery<SchemaStubRow>(ecsqlQueries.schemaStubQuery, {\n parameters: { schemaName: schemaKey.name },\n limit: 1\n });\n\n if (!schemaRow)\n return undefined;\n\n const schemaPartials: Array<SchemaProps> = [];\n const addSchema = async (key: SchemaKey) => {\n const stub = await this.createSchemaProps(key, context);\n schemaPartials.push(stub);\n\n if (stub.references) {\n for (const referenceProps of stub.references) {\n if (!schemaPartials.some((schema) => schema.name === referenceProps.name)) {\n await addSchema(SchemaKey.parseString(`${referenceProps.name}.${referenceProps.version}`));\n }\n }\n }\n\n return stub;\n };\n\n const addItems = async (schemaName: string, itemInfo: SchemaItemInfo) => {\n let schemaStub = schemaPartials.find((schema) => schema.name === schemaName);\n if (!schemaStub) {\n schemaStub = await addSchema(SchemaKey.parseString(`${schemaName}.0.0.0`));\n }\n\n if (!schemaStub.items) {\n Object.assign(schemaStub, { items: {} });\n }\n\n const existingItem = schemaStub.items![itemInfo.name] || {};\n Object.assign(schemaStub.items!, { [itemInfo.name]: Object.assign(existingItem, itemInfo) });\n };\n\n const reviver = (_key: string, value: any) => {\n if (value === null) {\n return undefined;\n }\n return value;\n };\n\n await addSchema(schemaKey);\n\n await parseSchemaItemStubs(schemaKey.name, context, JSON.parse(schemaRow.items, reviver), addItems);\n\n return schemaPartials;\n }\n\n private async querySchemaItem<TRow extends SchemaItemProps>(context: SchemaContext, schemaName: string, query: string, schemaType: string): Promise<Array<TRow>> {\n const start = Date.now();\n const itemRows = await this.executeQuery<SchemaItemRow>(query, { parameters: { schemaName } });\n this.options.performanceLogger?.logSchemaItem(start, schemaName, schemaType, itemRows.length);\n\n if (itemRows.length === 0)\n return [];\n\n const items = itemRows.map((itemRow: SchemaItemRow) => {\n return \"string\" === typeof itemRow.item ? JSON.parse(itemRow.item) : itemRow.item;\n });\n\n return await SchemaParser.parseSchemaItems(items, schemaName, context) as Array<TRow> ?? []\n }\n\n private async getFullSchema(schemaKey: SchemaKey, context: SchemaContext): Promise<SchemaProps | undefined> {\n const schemaRows = await this.executeQuery<SchemaRow>(FullSchemaQueries.schemaQuery, { parameters: { schemaName: schemaKey.name } });\n const schemaRow = schemaRows[0];\n if (schemaRow === undefined)\n return undefined;\n\n // Map SchemaItemRow array, [{item: SchemaItemProps}], to array of SchemaItemProps.\n const schema = JSON.parse(schemaRow.schema) as SchemaProps;\n if (schema.items) {\n (schema as any).items = (schema.items as any).map((itemRow: SchemaItemRow) => { return itemRow.item; });\n }\n\n return SchemaParser.parse(schema, context);\n }\n\n private async getFullSchemaMultipleQueries(schemaKey: SchemaKey, context: SchemaContext): Promise<SchemaProps | undefined> {\n const schema = await this.getSchemaNoItems(schemaKey.name, context) as MutableSchemaProps;\n if (!schema)\n return undefined;\n\n schema.items = {};\n await Promise.all([\n this.getEntities(schemaKey.name, context),\n this.getMixins(schemaKey.name, context),\n this.getStructs(schemaKey.name, context),\n this.getRelationships(schemaKey.name, context),\n this.getCustomAttributeClasses(schemaKey.name, context),\n this.getKindOfQuantities(schemaKey.name, context),\n this.getPropertyCategories(schemaKey.name, context),\n this.getEnumerations(schemaKey.name, context),\n this.getUnits(schemaKey.name, context),\n this.getInvertedUnits(schemaKey.name, context),\n this.getUnitSystems(schemaKey.name, context),\n this.getConstants(schemaKey.name, context),\n this.getPhenomenon(schemaKey.name, context),\n this.getFormats(schemaKey.name, context)\n ]).then((itemResults) => {\n const flatItemList = itemResults.reduce((acc, item) => acc.concat(item));\n flatItemList.forEach((schemaItem) => {\n schema.items![schemaItem.name!] = schemaItem;\n });\n });\n\n return schema;\n }\n}\n\nfunction parseSchemaReference(referenceName: string): WithSchemaKey {\n return { schemaKey: SchemaKey.parseString(referenceName) };\n}\n\nasync function parseSchemaItemStubs(schemaName: string, context: SchemaContext, itemRows: Array<SchemaItemStubRow>, addItemsHandler: AddSchemaItemHandler) {\n if (!itemRows || itemRows.length === 0) {\n return;\n }\n\n const parseBaseClasses = async (baseClasses: Array<BaseClassStubRow> | undefined) => {\n if (!baseClasses || baseClasses.length < 2)\n return;\n\n for (let index = baseClasses.length - 1; index >= 0;) {\n const currentItem = baseClasses[index--];\n const baseClassItem = baseClasses[index];\n const baseClassName = baseClassItem ? `${baseClassItem.schema}.${baseClassItem.name}` : undefined;\n\n const schemaItem = await SchemaParser.parseItem(currentItem, currentItem.schema, context);\n await addItemsHandler(currentItem.schema, {\n ...schemaItem,\n name: schemaItem.name!,\n schemaItemType: parseSchemaItemType(schemaItem.schemaItemType!)!,\n baseClass: baseClassName,\n });\n }\n };\n\n for (const itemRow of itemRows) {\n const schemaItem = await SchemaParser.parseItem(itemRow, schemaName, context);\n await addItemsHandler(schemaName, {\n ...schemaItem,\n name: schemaItem.name!,\n schemaItemType: parseSchemaItemType(schemaItem.schemaItemType!)!,\n mixins: itemRow.mixins\n ? itemRow.mixins.map(mixin => { return `${mixin.schema}.${mixin.name}`; })\n : undefined,\n });\n\n await parseBaseClasses(itemRow.baseClasses);\n\n for (const mixinRow of itemRow.mixins || []) {\n const mixinItem = await SchemaParser.parseItem(mixinRow, mixinRow.schema, context);\n await addItemsHandler(mixinRow.schema, {\n ...mixinItem,\n name: mixinItem.name!,\n schemaItemType: parseSchemaItemType(mixinItem.schemaItemType!)!,\n });\n await parseBaseClasses(mixinRow.baseClasses);\n }\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"ECSqlSchemaLocater.js","sourceRoot":"","sources":["../../../src/IncrementalLoading/ECSqlSchemaLocater.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAK7C,OAAO,EAAkB,eAAe,EAAE,MAAM,cAAc,CAAC;AAE/D,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACzC,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,EAAE,wBAAwB,EAAwB,MAAM,4BAA4B,CAAC;AAC5F,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AA+DnD,MAAM,eAAe,GAAG,sCAAsC,CAAC;AAqB/D;;;;GAIG;AACH,MAAM,OAAgB,kBAAmB,SAAQ,wBAAwB;IACvE;;OAEG;IACH,IAAuB,OAAO;QAC5B,OAAO,KAAK,CAAC,OAAoC,CAAC;IACpD,CAAC;IAED;;;OAGG;IACH,YAAY,OAAmC;QAC7C,KAAK,CAAC,OAAO,CAAC,CAAC;IACjB,CAAC;IAgBD;;;;;;OAMG;IACO,KAAK,CAAC,aAAa,CAAC,SAAoB,EAAE,OAAsB;QACxE,gHAAgH;QAChH,gHAAgH;QAChH,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AC,WAAW,CAAC,CAAC;QAC/C,CAAC;IACH,CAAC;AACH,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n * See LICENSE.md in the project root for license terms and full copyright notice.\n *--------------------------------------------------------------------------------------------*/\nimport { Logger } from \"@itwin/core-bentley\";\nimport { SchemaContext } from \"../Context\";\nimport { ConstantProps, CustomAttributeClassProps, EntityClassProps, EnumerationProps, InvertedUnitProps, KindOfQuantityProps, MixinProps,\n PhenomenonProps, PropertyCategoryProps, RelationshipClassProps, SchemaItemFormatProps, SchemaItemProps, SchemaItemUnitProps, SchemaProps,\n StructClassProps, UnitSystemProps } from \"../Deserialization/JsonProps\";\nimport { SchemaItemType, SchemaMatchType } from \"../ECObjects\";\nimport { SchemaInfo, WithSchemaKey } from \"../Interfaces\";\nimport { SchemaKey } from \"../SchemaKey\";\nimport { FullSchemaQueries } from \"./FullSchemaQueries\";\nimport { IncrementalSchemaLocater, SchemaLocaterOptions } from \"./IncrementalSchemaLocater\";\nimport { SchemaItemQueries } from \"./SchemaItemQueries\";\nimport { SchemaParser } from \"./SchemaParser\";\nimport { ecsqlQueries } from \"./SchemaStubQueries\";\n\ninterface SchemaItemInfo {\n readonly name: string;\n readonly schemaItemType: SchemaItemType;\n}\n\ninterface SchemaInfoRow {\n readonly name: string;\n readonly version: string;\n readonly alias: string;\n readonly references: string;\n}\n\ninterface SchemaStubRow {\n readonly name: string;\n readonly version: string;\n readonly alias: string;\n readonly displayLabel: string;\n readonly description: string;\n readonly references: string;\n readonly items: string;\n}\n\ninterface BaseClassStubRow {\n readonly schema: string;\n readonly name: string;\n readonly schemaItemType: string;\n readonly modifier: number;\n}\n\ninterface SchemaItemStubRow {\n readonly name: string;\n readonly schemaItemType: string;\n readonly modifier?: number;\n readonly baseClasses?: Array<BaseClassStubRow>;\n readonly mixins?: Array<{\n readonly schema: string,\n readonly name: string;\n readonly schemaItemType: string;\n readonly modifier: number;\n readonly baseClasses?: Array<BaseClassStubRow>\n }>;\n}\n\ninterface SchemaRow {\n schema: string\n}\n\ninterface SchemaItemRow {\n item: string | SchemaItemProps;\n}\n\ntype AddSchemaItemHandler = <T extends SchemaItemInfo>(schemaName: string, itemStub: T) => Promise<void>;\n\ntype MutableSchemaProps = {\n -readonly [K in keyof SchemaProps]: SchemaProps[K];\n};\n\ninterface QueryParameters {\n [parameterName: string]: string | number;\n}\n\nconst LOGGER_CATEGORY = \"IncrementalSchemaLoading.Performance\";\n\n/**\n * Query options used by the ECSqlSchemaLocater.\n * @internal\n */\nexport interface ECSqlQueryOptions {\n parameters?: QueryParameters;\n limit?: number;\n}\n\n/**\n * Defines the [[ECSqlSchemaLocater]] options which determine how each\n * schema is to be loaded. All options are optional.\n * @internal\n */\nexport interface ECSqlSchemaLocaterOptions extends SchemaLocaterOptions {\n /** Query for Schemas using multiple queries. Defaults to false. */\n readonly useMultipleQueries?: boolean;\n}\n\n/**\n * An abstract [[IncrementalSchemaLocater]] implementation for loading\n * EC [Schema] instances from an iModelDb using ECSql queries.\n * @internal\n */\nexport abstract class ECSqlSchemaLocater extends IncrementalSchemaLocater {\n /**\n * Gets the [[ECSqlSchemaLocaterOptions]] used by this locater.\n */\n protected override get options(): ECSqlSchemaLocaterOptions {\n return super.options as ECSqlSchemaLocaterOptions;\n }\n\n /**\n * Initializes a new ECSqlSchemaLocater instance.\n * @param options The options used by this Schema locater.\n */\n constructor(options?: ECSqlSchemaLocaterOptions) {\n super(options);\n }\n\n /**\n * Executes the given ECSql query and returns the resulting rows.\n * @param query The ECSql query to execute.\n * @param options Optional arguments to control the query result.\n * @returns A promise that resolves to the resulting rows.\n */\n protected abstract executeQuery<TRow>(query: string, options?: ECSqlQueryOptions): Promise<ReadonlyArray<TRow>>;\n\n /**\n * Gets the [[SchemaProps]] for the given schema key.\n * @param schemaKey The schema key of the schema to be resolved.\n */\n protected abstract getSchemaProps(schemaKey: SchemaKey): Promise<SchemaProps | undefined>\n\n /**\n * Gets the [[SchemaProps]] for the given schema key. This is the full schema json with all elements that are defined\n * in the schema. The schema locater calls this after the stub has been loaded to fully load the schema in the background.\n * @param schemaKey The [[SchemaKey]] of the schema to be resolved.\n * @param context The [[SchemaContext]] to use for resolving references.\n * @internal\n */\n protected async getSchemaJson(schemaKey: SchemaKey, context: SchemaContext): Promise<SchemaProps | undefined> {\n // If the meta schema is an earlier version than 4.0.3, we can't use the ECSql query interface to get the schema\n // information required to load the schema entirely. In this case, we fallback to use the ECSchema RPC interface\n // to fetch the whole schema json.\n if (!await this.supportPartialSchemaLoading(context))\n return this.getSchemaProps(schemaKey);\n\n const queryStart = Date.now();\n const schemaProps = this.options.useMultipleQueries\n ? await this.getFullSchemaMultipleQueries(schemaKey, context)\n : await this.getFullSchema(schemaKey, context);\n\n const queryDuration = Date.now() - queryStart;\n Logger.logTrace(LOGGER_CATEGORY, `Recieved SchemaProps for ${schemaKey.name} in ${queryDuration}ms`, {\n schemaName: schemaKey.name,\n queryMode: this.options.useMultipleQueries ? \"parallel\" : \"single\",\n duration: queryDuration,\n });\n\n return schemaProps;\n };\n\n /**\n * Gets the [[SchemaProps]] without schemaItems for the given schema name.\n * @param schemaName The name of the Schema.\n * @param context The [[SchemaContext]] to use for resolving references.\n * @returns\n * @internal\n */\n private async getSchemaNoItems(schemaName: string, context: SchemaContext): Promise<SchemaProps | undefined> {\n const schemaRows = await this.executeQuery<SchemaRow>(FullSchemaQueries.schemaNoItemsQuery, { parameters: { schemaName } });\n const schemaRow = schemaRows[0];\n if (schemaRow === undefined)\n return undefined;\n\n const schema = JSON.parse(schemaRow.schema) as SchemaProps;\n const schemaInfos = await this._schemaInfoCache.getSchemasByContext(context) ?? [];\n return SchemaParser.parse(schema, schemaInfos);\n }\n\n /**\n * Checks if the [[SchemaContext]] has the right Meta Schema version to support the incremental schema loading.\n * @param context The schema context to lookup the meta schema.\n * @returns true if the context has a supported meta schema version, false otherwise.\n */\n protected async supportPartialSchemaLoading(context: SchemaContext): Promise<boolean> {\n const metaSchemaKey = new SchemaKey(\"ECDbMeta\", 4, 0, 3);\n const metaSchemaInfo = await context.getSchemaInfo(metaSchemaKey, SchemaMatchType.LatestWriteCompatible);\n return metaSchemaInfo !== undefined;\n };\n\n /**\n * Gets all the Schema's Entity classes as [[EntityClassProps]] JSON objects.\n * @param schemaName The name of the Schema.\n * @param context The [[SchemaContext]] to which the schema belongs.\n * @returns A promise that resolves to a EntityClassProps array. Maybe empty of no entities are found.\n * @internal\n */\n protected async getEntities(schema: string, context: SchemaContext, queryOverride?: string): Promise<EntityClassProps[]> {\n const query = queryOverride ?? FullSchemaQueries.entityQuery;\n return this.querySchemaItem<EntityClassProps>(context, schema, query, \"EntityClass\");\n }\n\n /**\n * Gets all the Schema's Mixin classes as [[MixinProps]] JSON objects.\n * @param schemaName The name of the Schema.\n * @param context The SchemaContext to which the schema belongs.\n * @returns A promise that resolves to a MixinProps array. Maybe empty of no entities are found.\n * @internal\n */\n protected async getMixins(schema: string, context: SchemaContext, queryOverride?: string): Promise<MixinProps[]> {\n const query = queryOverride ?? FullSchemaQueries.mixinQuery;\n return this.querySchemaItem<MixinProps>(context, schema, query, \"Mixin\");\n }\n\n /**\n * Gets all the Schema's Relationship classes as [[RelationshipClassProps]] JSON objects.\n * @param schemaName The name of the Schema.\n * @param context The SchemaContext to which the schema belongs.\n * @returns A promise that resolves to a RelationshipClassProps array. Maybe empty if no items are found.\n * @internal\n */\n protected async getRelationships(schema: string, context: SchemaContext, queryOverride?: string): Promise<RelationshipClassProps[]> {\n const query = queryOverride ?? FullSchemaQueries.relationshipClassQuery;\n return this.querySchemaItem<RelationshipClassProps>(context, schema, query, \"RelationshipClass\");\n }\n\n /**\n * Gets all the Schema's CustomAttributeClass items as [[CustomAttributeClassProps]] JSON objects.\n * @param schemaName The name of the Schema.\n * @param context The SchemaContext to which the schema belongs.\n * @returns A promise that resolves to a CustomAttributeClassProps array. Maybe empty if not items are found.\n * @internal\n */\n protected async getCustomAttributeClasses(schema: string, context: SchemaContext, queryOverride?: string): Promise<CustomAttributeClassProps[]> {\n const query = queryOverride ?? FullSchemaQueries.customAttributeQuery;\n return this.querySchemaItem<CustomAttributeClassProps>(context, schema, query, \"CustomAttributeClass\");\n }\n\n\n /**\n * Gets all the Schema's StructClass items as [[StructClassProps]] JSON objects.\n * @param schemaName The name of the Schema.\n * @param context The SchemaContext to which the schema belongs.\n * @returns A promise that resolves to a StructClassProps array. Maybe empty if not items are found.\n * @internal\n */\n protected async getStructs(schema: string, context: SchemaContext, queryOverride?: string): Promise<StructClassProps[]> {\n const query = queryOverride ?? FullSchemaQueries.structQuery;\n return this.querySchemaItem<StructClassProps>(context, schema, query, \"StructClass\");\n }\n\n /**\n * Gets all the Schema's KindOfQuantity items as [[KindOfQuantityProps]] JSON objects.\n * @param schema The name of the Schema.\n * @param context The SchemaContext to which the schema belongs.\n * @returns A promise that resolves to a KindOfQuantityProps array. Maybe empty if not items are found.\n * @internal\n */\n protected async getKindOfQuantities(schema: string, context: SchemaContext): Promise<KindOfQuantityProps[]> {\n return this.querySchemaItem<KindOfQuantityProps>(context, schema, SchemaItemQueries.kindOfQuantity(true), \"KindOfQuantity\");\n }\n\n /**\n * Gets all the Schema's PropertyCategory items as [[PropertyCategoryProps]] JSON objects.\n * @param schema The name of the Schema.\n * @param context The SchemaContext to which the schema belongs.\n * @returns A promise that resolves to a PropertyCategoryProps array. Maybe empty if not items are found.\n * @internal\n */\n protected async getPropertyCategories(schema: string, context: SchemaContext): Promise<PropertyCategoryProps[]> {\n return this.querySchemaItem<PropertyCategoryProps>(context, schema, SchemaItemQueries.propertyCategory(true), \"PropertyCategory\");\n }\n\n /**\n * Gets all the Schema's Enumeration items as [[EnumerationProps]] JSON objects.\n * @param schema The name of the Schema.\n * @param context The SchemaContext to which the schema belongs.\n * @returns A promise that resolves to a EnumerationProps array. Maybe empty if not items are found.\n * @internal\n */\n protected async getEnumerations(schema: string, context: SchemaContext): Promise<EnumerationProps[]> {\n return this.querySchemaItem<EnumerationProps>(context, schema, SchemaItemQueries.enumeration(true), \"Enumeration\");\n }\n\n /**\n * Gets all the Schema's Unit items as [[SchemaItemUnitProps]] JSON objects.\n * @param schema The name of the Schema.\n * @param context The SchemaContext to which the schema belongs.\n * @returns A promise that resolves to a SchemaItemUnitProps array. Maybe empty if not items are found.\n * @internal\n */\n protected async getUnits(schema: string, context: SchemaContext): Promise<SchemaItemUnitProps[]> {\n return this.querySchemaItem<SchemaItemUnitProps>(context, schema, SchemaItemQueries.unit(true), \"Unit\");\n }\n\n /**\n * Gets all the Schema's InvertedUnit items as [[InvertedUnitProps]] JSON objects.\n * @param schema The name of the Schema.\n * @param context The SchemaContext to which the schema belongs.\n * @returns A promise that resolves to a InvertedUnitProps array. Maybe empty if not items are found.\n * @internal\n */\n protected async getInvertedUnits(schema: string, context: SchemaContext): Promise<InvertedUnitProps[]> {\n return this.querySchemaItem<InvertedUnitProps>(context, schema, SchemaItemQueries.invertedUnit(true), \"InvertedUnit\");\n }\n\n /**\n * Gets all the Schema's Constant items as [[ConstantProps]] JSON objects.\n * @param schema The name of the Schema.\n * @param context The SchemaContext to which the schema belongs.\n * @returns A promise that resolves to a ConstantProps array. Maybe empty if not items are found.\n * @internal\n */\n protected async getConstants(schema: string, context: SchemaContext): Promise<ConstantProps[]> {\n return this.querySchemaItem<ConstantProps>(context, schema, SchemaItemQueries.constant(true), \"Constant\");\n }\n\n /**\n * Gets all the Schema's UnitSystem items as [[UnitSystemProps]] JSON objects.\n * @param schema The name of the Schema.\n * @param context The SchemaContext to which the schema belongs.\n * @returns A promise that resolves to a UnitSystemProps array. Maybe empty if not items are found.\n * @internal\n */\n protected async getUnitSystems(schema: string, context: SchemaContext): Promise<UnitSystemProps[]> {\n return this.querySchemaItem<UnitSystemProps>(context, schema, SchemaItemQueries.unitSystem(true), \"UnitSystem\");\n }\n\n /**\n * Gets all the Schema's Phenomenon items as [[PhenomenonProps]] JSON objects.\n * @param schema The name of the Schema.\n * @param context The SchemaContext to which the schema belongs.\n * @returns A promise that resolves to a PhenomenonProps array. Maybe empty if not items are found.\n * @internal\n */\n protected async getPhenomenon(schema: string, context: SchemaContext): Promise<PhenomenonProps[]> {\n return this.querySchemaItem<PhenomenonProps>(context, schema, SchemaItemQueries.phenomenon(true), \"Phenomenon\");\n }\n\n /**\n * Gets all the Schema's Format items as [[SchemaItemFormatProps]] JSON objects.\n * @param schema The name of the Schema.\n * @param context The SchemaContext to which the schema belongs.\n * @returns A promise that resolves to a SchemaItemFormatProps array. Maybe empty if not items are found.\n * @internal\n */\n protected async getFormats(schema: string, context: SchemaContext): Promise<SchemaItemFormatProps[]> {\n return this.querySchemaItem<SchemaItemFormatProps>(context, schema, SchemaItemQueries.format(true), \"Format\");\n }\n\n /**\n * Gets [[SchemaInfo]] objects for all schemas including their direct schema references.\n * @internal\n */\n protected async loadSchemaInfos(): Promise<ReadonlyArray<SchemaInfo>> {\n const schemaRows = await this.executeQuery<SchemaInfoRow>(ecsqlQueries.schemaInfoQuery);\n return schemaRows.map((schemaRow) => (\n {\n alias: schemaRow.alias,\n schemaKey: SchemaKey.parseString(`${schemaRow.name}.${schemaRow.version}`),\n references: Array.from(JSON.parse(schemaRow.references), parseSchemaReference),\n }\n ));\n }\n\n /**\n * Gets the [[SchemaProps]] to create the basic schema skeleton. Depending on which options are set, the schema items or class hierarchy\n * can be included in the initial fetch.\n * @param schemaKey The [[SchemaKey]] of the schema to be resolved.\n * @returns A promise that resolves to the schema partials, which is an array of [[SchemaProps]].\n * @internal\n */\n protected async getSchemaPartials(schemaKey: SchemaKey, context: SchemaContext): Promise<ReadonlyArray<SchemaProps> | undefined> {\n const queryStart = Date.now();\n const [schemaRow] = await this.executeQuery<SchemaStubRow>(ecsqlQueries.schemaStubQuery, {\n parameters: { schemaName: schemaKey.name },\n limit: 1\n });\n\n const queryDuration = Date.now() - queryStart;\n Logger.logTrace(LOGGER_CATEGORY, `Recieved PartialSchema for ${schemaKey.name} in ${queryDuration}ms`, {\n schemaName: schemaKey.name,\n duration: queryDuration,\n });\n\n if (!schemaRow)\n return undefined;\n\n const schemaPartials: Array<SchemaProps> = [];\n const addSchema = async (key: SchemaKey) => {\n const stub = await this.createSchemaProps(key, context);\n schemaPartials.push(stub);\n\n if (stub.references) {\n for (const referenceProps of stub.references) {\n if (!schemaPartials.some((schema) => schema.name === referenceProps.name)) {\n await addSchema(SchemaKey.parseString(`${referenceProps.name}.${referenceProps.version}`));\n }\n }\n }\n\n return stub;\n };\n\n const addItems = async (schemaName: string, itemInfo: SchemaItemInfo) => {\n let schemaStub = schemaPartials.find((schema) => schema.name === schemaName);\n if (!schemaStub) {\n schemaStub = await addSchema(SchemaKey.parseString(`${schemaName}.0.0.0`));\n }\n\n let items = schemaStub.items;\n if (!items) {\n Object.assign(schemaStub, items = { items: {} });\n }\n\n const existingItem = items[itemInfo.name] || {};\n Object.assign(items, { [itemInfo.name]: Object.assign(existingItem, itemInfo) });\n };\n\n const reviver = (_key: string, value: any) => {\n if (value === null) {\n return undefined;\n }\n return value;\n };\n\n await addSchema(schemaKey);\n\n const schemaInfos = await this._schemaInfoCache.getSchemasByContext(context) ?? [];\n await parseSchemaItemStubs(schemaKey.name, JSON.parse(schemaRow.items, reviver), addItems, schemaInfos);\n\n return schemaPartials;\n }\n\n private async querySchemaItem<TRow extends SchemaItemProps>(context: SchemaContext, schemaName: string, query: string, schemaType: string): Promise<Array<TRow>> {\n const start = Date.now();\n const itemRows = await this.executeQuery<SchemaItemRow>(query, { parameters: { schemaName } });\n\n const queryDuration = Date.now() - start;\n Logger.logTrace(LOGGER_CATEGORY, `Recieved rows of ${schemaType} items for ${schemaName} in ${queryDuration}ms`, {\n schemaName,\n itemCount: itemRows.length,\n itemType: schemaType,\n duration: queryDuration,\n });\n\n if (itemRows.length === 0)\n return [];\n\n const items = itemRows.map((itemRow: SchemaItemRow) => {\n return \"string\" === typeof itemRow.item ? JSON.parse(itemRow.item) : itemRow.item;\n });\n\n const schemaInfos = await this._schemaInfoCache.getSchemasByContext(context) ?? [];\n return await SchemaParser.parseSchemaItems(items, schemaName, schemaInfos) as Array<TRow> ?? []\n }\n\n private async getFullSchema(schemaKey: SchemaKey, context: SchemaContext): Promise<SchemaProps | undefined> {\n const schemaRows = await this.executeQuery<SchemaRow>(FullSchemaQueries.schemaQuery, { parameters: { schemaName: schemaKey.name } });\n const schemaRow = schemaRows[0];\n if (schemaRow === undefined)\n return undefined;\n\n // Map SchemaItemRow array, [{item: SchemaItemProps}], to array of SchemaItemProps.\n const schema = JSON.parse(schemaRow.schema) as SchemaProps;\n if (schema.items) {\n (schema as any).items = (schema.items as any).map((itemRow: SchemaItemRow) => { return itemRow.item; });\n }\n\n const schemaInfos = await this._schemaInfoCache.getSchemasByContext(context) ?? [];\n return SchemaParser.parse(schema, schemaInfos);\n }\n\n private async getFullSchemaMultipleQueries(schemaKey: SchemaKey, context: SchemaContext): Promise<SchemaProps | undefined> {\n const schema = await this.getSchemaNoItems(schemaKey.name, context) as MutableSchemaProps;\n if (!schema)\n return undefined;\n\n const items = schema.items || (schema.items = {});\n await Promise.all([\n this.getEntities(schemaKey.name, context),\n this.getMixins(schemaKey.name, context),\n this.getStructs(schemaKey.name, context),\n this.getRelationships(schemaKey.name, context),\n this.getCustomAttributeClasses(schemaKey.name, context),\n this.getKindOfQuantities(schemaKey.name, context),\n this.getPropertyCategories(schemaKey.name, context),\n this.getEnumerations(schemaKey.name, context),\n this.getUnits(schemaKey.name, context),\n this.getInvertedUnits(schemaKey.name, context),\n this.getUnitSystems(schemaKey.name, context),\n this.getConstants(schemaKey.name, context),\n this.getPhenomenon(schemaKey.name, context),\n this.getFormats(schemaKey.name, context)\n ]).then((itemResults) => {\n const flatItemList = itemResults.reduce((acc, result) => acc.concat(result));\n flatItemList.forEach((schemaItem) => {\n if(!schemaItem.name) {\n // This should never be happen, as we query the schema items by name from the database, but since the SchemaProps\n // have name optional, we need the check here to make the compiler happy.\n throw new Error(`SchemaItem with no name encountered in schema ${schemaKey.name}`);\n }\n items[schemaItem.name] = schemaItem;\n });\n });\n\n return schema;\n }\n}\n\nfunction parseSchemaReference(referenceName: string): WithSchemaKey {\n return { schemaKey: SchemaKey.parseString(referenceName) };\n}\n\nasync function parseSchemaItemStubs(schemaName: string, itemRows: Array<SchemaItemStubRow>, addItemsHandler: AddSchemaItemHandler, schemaInfos: Iterable<SchemaInfo>) {\n if (!itemRows || itemRows.length === 0) {\n return;\n }\n\n const parseBaseClasses = async (baseClasses: Array<BaseClassStubRow> | undefined) => {\n if (!baseClasses || baseClasses.length < 2)\n return;\n\n for (let index = baseClasses.length - 1; index >= 0;) {\n const currentItem = baseClasses[index--];\n const baseClassItem = baseClasses[index];\n const baseClassName = baseClassItem ? `${baseClassItem.schema}.${baseClassItem.name}` : undefined;\n\n const schemaItem = await SchemaParser.parseItem(currentItem, currentItem.schema, schemaInfos);\n await addItemsHandler(currentItem.schema, {\n ...schemaItem,\n name: schemaItem.name,\n schemaItemType: schemaItem.schemaItemType,\n baseClass: baseClassName,\n });\n }\n };\n\n for (const itemRow of itemRows) {\n const schemaItem = await SchemaParser.parseItem(itemRow, schemaName, schemaInfos);\n await addItemsHandler(schemaName, {\n ...schemaItem,\n name: schemaItem.name,\n schemaItemType: schemaItem.schemaItemType,\n mixins: itemRow.mixins\n ? itemRow.mixins.map(mixin => { return `${mixin.schema}.${mixin.name}`; })\n : undefined,\n });\n\n await parseBaseClasses(itemRow.baseClasses);\n\n for (const mixinRow of itemRow.mixins || []) {\n const mixinItem = await SchemaParser.parseItem(mixinRow, mixinRow.schema, schemaInfos);\n await addItemsHandler(mixinRow.schema, {\n ...mixinItem,\n name: mixinItem.name,\n schemaItemType: mixinItem.schemaItemType,\n });\n await parseBaseClasses(mixinRow.baseClasses);\n }\n }\n}\n"]}
|
|
@@ -4,6 +4,7 @@ import { SchemaMatchType } from "../ECObjects";
|
|
|
4
4
|
import { SchemaInfo } from "../Interfaces";
|
|
5
5
|
import { Schema } from "../Metadata/Schema";
|
|
6
6
|
import { SchemaKey } from "../SchemaKey";
|
|
7
|
+
type LoadSchemaInfoHandler = (context: SchemaContext) => Promise<Iterable<SchemaInfo>>;
|
|
7
8
|
/**
|
|
8
9
|
* Defines the SchemaLocater Options which determine how each schema is to be loaded.
|
|
9
10
|
* All options are optional.
|
|
@@ -24,7 +25,7 @@ export interface SchemaLocaterOptions {
|
|
|
24
25
|
*/
|
|
25
26
|
export declare abstract class IncrementalSchemaLocater implements ISchemaLocater {
|
|
26
27
|
private readonly _options;
|
|
27
|
-
|
|
28
|
+
protected readonly _schemaInfoCache: SchemaInfoCache;
|
|
28
29
|
/**
|
|
29
30
|
* Initializes a new instance of the IncrementalSchemaLocater class.
|
|
30
31
|
* @param options The [[SchemaLocaterOptions]] that control the loading of the schema.
|
|
@@ -78,7 +79,7 @@ export declare abstract class IncrementalSchemaLocater implements ISchemaLocater
|
|
|
78
79
|
* @param context The schema context to load the schema infos for.
|
|
79
80
|
* @returns A promise that resolves to an iterable of schema infos.
|
|
80
81
|
*/
|
|
81
|
-
abstract loadSchemaInfos(context: SchemaContext): Promise<Iterable<SchemaInfo>>;
|
|
82
|
+
protected abstract loadSchemaInfos(context: SchemaContext): Promise<Iterable<SchemaInfo>>;
|
|
82
83
|
/**
|
|
83
84
|
* Checks if the context contains the right schemas to support incremental schema loading.
|
|
84
85
|
* @param context The schema context to check.
|
|
@@ -93,7 +94,7 @@ export declare abstract class IncrementalSchemaLocater implements ISchemaLocater
|
|
|
93
94
|
* @param schemaInfo The schema info of the schema to load.
|
|
94
95
|
* @param schemaContext The schema context to load the schema into.
|
|
95
96
|
*/
|
|
96
|
-
loadSchema(schemaInfo: SchemaInfo, schemaContext: SchemaContext): Promise<Schema>;
|
|
97
|
+
protected loadSchema(schemaInfo: SchemaInfo, schemaContext: SchemaContext): Promise<Schema>;
|
|
97
98
|
/**
|
|
98
99
|
* Creates a SchemaProps object by loading the Schema information from the given SchemaContext.
|
|
99
100
|
* @param schemaKey The SchemaKey of the Schema whose props are to be retrieved.
|
|
@@ -106,4 +107,16 @@ export declare abstract class IncrementalSchemaLocater implements ISchemaLocater
|
|
|
106
107
|
private startLoadingFullSchema;
|
|
107
108
|
private sortSchemaPartials;
|
|
108
109
|
}
|
|
110
|
+
/**
|
|
111
|
+
* Helper class to manage schema infos for a schema context.
|
|
112
|
+
*/
|
|
113
|
+
declare class SchemaInfoCache {
|
|
114
|
+
private readonly _schemaInfoCache;
|
|
115
|
+
private readonly _schemaInfoLoader;
|
|
116
|
+
constructor(schemaInfoLoader: LoadSchemaInfoHandler);
|
|
117
|
+
getSchemasByContext(context: SchemaContext): Promise<SchemaInfo[] | undefined>;
|
|
118
|
+
lookup(schemaKey: SchemaKey, matchType: SchemaMatchType, context: SchemaContext): Promise<SchemaInfo | undefined>;
|
|
119
|
+
remove(schemaKey: SchemaKey, context: SchemaContext): void;
|
|
120
|
+
}
|
|
121
|
+
export {};
|
|
109
122
|
//# sourceMappingURL=IncrementalSchemaLocater.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IncrementalSchemaLocater.d.ts","sourceRoot":"","sources":["../../../src/IncrementalLoading/IncrementalSchemaLocater.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAC3D,OAAO,EAAE,WAAW,
|
|
1
|
+
{"version":3,"file":"IncrementalSchemaLocater.d.ts","sourceRoot":"","sources":["../../../src/IncrementalLoading/IncrementalSchemaLocater.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAC3D,OAAO,EAAE,WAAW,EAAwB,MAAM,8BAA8B,CAAC;AAEjF,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAE/C,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAC3C,OAAO,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAC5C,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAIzC,K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