Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
46 commits
Select commit Hold shift + click to select a range
d2fba12
refactor(ecschema-metadata): move SchemaView into src/SchemaView subf…
rschili Jun 19, 2026
38bc119
feat: add schema_view_fragment pragma for incremental schema loading
rschili Jun 20, 2026
5c360a4
feat: implement incremental schema loading with schema_view_fragment …
rschili Jun 20, 2026
016920f
docs: update SchemaView documentation for clarity and consistency
rschili Jun 20, 2026
84f8772
docs: rename SchemaView section to Intro for improved clarity
rschili Jun 21, 2026
bf9bacd
docs: update references from PRAGMA schema_token to PRAGMA checksum(s…
rschili Jun 23, 2026
1d668d1
fix: update primitiveType from uint8 to uint16 in SchemaView binary f…
rschili Jun 23, 2026
61ae7d2
test: enhance SchemaViewFragmentLoading tests with native log capturing
rschili Jun 23, 2026
17b73ef
Merge branch 'master' into rschili/schema-view-fragment
rschili Jun 26, 2026
7dcbd6e
Fix documentation for PRAGMA schema_view and schema_view_fragment to …
rschili Jun 26, 2026
df29492
Refactor comments in SchemaViewFragmentLoading tests for clarity and …
rschili Jun 29, 2026
be62c05
Refactor SchemaView documentation for clarity and conciseness
rschili Jun 29, 2026
9770c9a
Refactor SchemaView documentation for clarity and conciseness
rschili Jun 29, 2026
51b3ac0
Merge branch 'master' into rschili/schema-view-fragment
rschili Jun 30, 2026
33510bc
Refactor schema loading logic in IModelDb to improve promise handling
rschili Jun 30, 2026
4e92bc2
Merge branch 'rschili/schema-view-fragment' of https://github.com/iTw…
rschili Jun 30, 2026
dacf252
Refactor SchemaManifest and related components for improved clarity a…
rschili Jul 2, 2026
1b932e0
Enhance IModelDb schema loading logic and add entries getter in Schem…
rschili Jul 2, 2026
bb1c7a2
Add internal documentation and improve error handling in SchemaView a…
rschili Jul 2, 2026
d988637
Refactor SchemaView fragment loading tests to use StandaloneDb and im…
rschili Jul 2, 2026
898b6fb
Merge branch 'master' into rschili/schema-view-fragment
rschili Jul 2, 2026
057699b
Merge branch 'rschili/schema-view-fragment' of https://github.com/iTw…
rschili Jul 2, 2026
0812a46
feat(schema): Implement SchemaViewManager for improved schema loading…
rschili Jul 2, 2026
1fbeddb
refactor(schema): Update schema view fragment handling to use schema …
rschili Jul 3, 2026
33a681d
Merge remote-tracking branch 'origin/master' into rschili/schema-view…
rschili Jul 20, 2026
f31f98b
Merge branch 'master' into rschili/schema-view-fragment
rschili Jul 23, 2026
cf327bc
Potential fix for pull request finding
rschili Jul 23, 2026
bbef643
Potential fix for pull request finding
rschili Jul 23, 2026
7a24cdf
Merge branch 'master' into rschili/schema-view-fragment
rschili Jul 23, 2026
a486862
Refactor schema view cache management in tests to use SchemaViewManager
rschili Jul 23, 2026
ca5b8dd
revert generated unit file
rschili Jul 23, 2026
320174d
Add schema filter to SchemaView for core-backend, core-frontend, core…
rschili Jul 23, 2026
368275b
extract-api and fix some broken links
rschili Jul 23, 2026
5886372
Potential fix for pull request finding
rschili Jul 23, 2026
11b79b1
Potential fix for pull request finding
rschili Jul 24, 2026
60c584d
Potential fix for pull request finding
rschili Jul 24, 2026
8d8025f
Merge branch 'master' into rschili/schema-view-fragment
rschili Jul 24, 2026
228c156
Add performance comparison test for SchemaView and improve validation…
rschili Jul 24, 2026
d610576
fix linter problem and strip unnecessary details from docs
rschili Jul 24, 2026
9a86cff
Update rschili-schema-view-fragment_2026-07-23-15-54-03.json
rschili Jul 24, 2026
5080323
Update rschili-schema-view-fragment_2026-07-23-15-54-03.json
rschili Jul 24, 2026
6e7e358
Update rschili-schema-view-fragment_2026-07-23-15-54-03.json
rschili Jul 24, 2026
1be1c24
Fix comment based on review nit.
rschili Jul 24, 2026
57deda8
Merge branch 'rschili/schema-view-fragment' of https://github.com/iTw…
rschili Jul 24, 2026
77c8b35
refactor: Improve documentation and comments in SchemaView and relate…
rschili Jul 25, 2026
c6b23f5
refactor: Rework some documentation and skip one unnecessary invalida…
rschili Jul 25, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion common/api/core-backend.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,7 @@ import { GeometryContainmentResponseProps } from '@itwin/core-common';
import { GeometryParams } from '@itwin/core-common';
import { GeometryPartProps } from '@itwin/core-common';
import { GeometryStreamProps } from '@itwin/core-common';
import { GetSchemaViewArgs } from '@itwin/ecschema-metadata';
import { GuidString } from '@itwin/core-bentley';
import { Id64Arg } from '@itwin/core-bentley';
import { Id64Array } from '@itwin/core-bentley';
Expand Down Expand Up @@ -4104,7 +4105,7 @@ export abstract class IModelDb extends IModel {
getMetaData(classFullName: string): EntityMetaData;
getSchemaProps(name: string): ECSchemaProps;
// @beta
getSchemaView(): Promise<SchemaView>;
getSchemaView(args?: GetSchemaViewArgs): Promise<SchemaView>;
get holdsSchemaLock(): boolean;
get iModelId(): GuidString;
importSchemas(schemaFileNames: LocalFileName[], options?: SchemaImportOptions): Promise<void>;
Expand Down
3 changes: 2 additions & 1 deletion common/api/core-frontend.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,7 @@ import { GeometryContainmentResponseProps } from '@itwin/core-common';
import { GeometryQuery } from '@itwin/core-geometry';
import { GeometryStreamProps } from '@itwin/core-common';
import { GeometrySummaryRequestProps } from '@itwin/core-common';
import { GetSchemaViewArgs } from '@itwin/ecschema-metadata';
import { GlobeMode } from '@itwin/core-common';
import { Gradient } from '@itwin/core-common';
import { GraphicParams } from '@itwin/core-common';
Expand Down Expand Up @@ -5208,7 +5209,7 @@ export abstract class IModelConnection extends IModel {
// @deprecated
getMassPropertiesPerCandidate(requestProps: MassPropertiesPerCandidateRequestProps): Promise<MassPropertiesPerCandidateResponseProps[]>;
// @beta
getSchemaView(): Promise<SchemaView>;
getSchemaView(args?: GetSchemaViewArgs): Promise<SchemaView>;
getToolTipMessage(id: Id64String): Promise<string[]>;
readonly hilited: HiliteSet;
// @internal
Expand Down
117 changes: 114 additions & 3 deletions common/api/ecschema-metadata.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -923,6 +923,13 @@ export class FormatSetFormatsProvider implements MutableFormatsProvider {
// @internal (undocumented)
export function getFormatProps(format: Format | OverrideFormat): FormatProps;

// @beta
export interface GetSchemaViewArgs {
// @internal
readonly forceReload?: boolean;
readonly schemas?: readonly string[];
}

// @public @preview
export interface HasMixins {
// (undocumented)
Expand Down Expand Up @@ -2492,6 +2499,56 @@ export interface SchemaLocaterOptions {
readonly loadPartialSchemaOnly?: boolean;
}

// @beta
export class SchemaManifest {
constructor(entries: readonly SchemaManifestEntry[]);
// (undocumented)
get entries(): readonly SchemaManifestEntry[];
findByName(name: string): SchemaManifestEntry | undefined;
// @internal
static fromRows(schemaRows: readonly SchemaManifestSchemaRow[], referenceRows: readonly SchemaManifestReferenceRow[]): SchemaManifest;
getAvailableSchemaNames(): string[];
getSchemaClosure(requestedNames: Iterable<string>): string[];
get schemaCount(): number;
// @internal
sortInDependencyOrder(schemaNames: Iterable<string>): string[];
}

// @beta
export interface SchemaManifestEntry {
// (undocumented)
readonly minorVersion: number;
// (undocumented)
readonly name: string;
// (undocumented)
readonly readVersion: number;
readonly references: readonly SchemaManifestEntry[];
// (undocumented)
readonly writeVersion: number;
}

// @internal
export interface SchemaManifestReferenceRow {
// (undocumented)
readonly sourceECInstanceId: number;
// (undocumented)
readonly targetECInstanceId: number;
}

// @internal
export interface SchemaManifestSchemaRow {
// (undocumented)
readonly ecInstanceId: number;
// (undocumented)
readonly name: string;
// (undocumented)
readonly versionMajor: number;
// (undocumented)
readonly versionMinor: number;
// (undocumented)
readonly versionWrite: number;
}

// @public @preview
export enum SchemaMatchType {
// (undocumented)
Expand Down Expand Up @@ -2584,17 +2641,17 @@ export class SchemaView {
// @internal (undocumented)
readonly [_storage]: SchemaViewStorage;
// @internal
constructor(data: SchemaViewData, schemaToken?: string);
constructor(data: SchemaViewData, schemaToken?: string, mergeContext?: SchemaViewMergeContext);
// @internal (undocumented)
buildDerivedClassMap(): ReadonlyMap<number, readonly number[]>;
get classCount(): number;
// @internal
static createMergeable(schemaToken?: string): SchemaView;
findClass(qualifiedName: string): SchemaView.Class | undefined;
findEnumeration(qualifiedName: string): SchemaView.Enumeration | undefined;
findKindOfQuantity(qualifiedName: string): SchemaView.KindOfQuantity | undefined;
findPropertyCategory(qualifiedName: string): SchemaView.PropertyCategory | undefined;
static fromBinary(blob: Uint8Array, schemaToken?: string): SchemaView;
// @internal
static fromBuilder(builder: SchemaViewBuilder, schemaToken?: string): SchemaView;
getSchema(name: string): SchemaView.Schema | undefined;
getSchemaByAlias(alias: string): SchemaView.Schema | undefined;
getSchemas(): IterableIterator<SchemaView.Schema>;
Expand All @@ -2603,12 +2660,16 @@ export class SchemaView {
get isOutdated(): boolean;
// @internal
markOutdated(): void;
// @internal
mergeFragment(blob: Uint8Array): void;
// @internal (undocumented)
resolveAllProperties(classIdx: number): readonly ResolvedPropertyRef[];
// @internal (undocumented)
resolveClassIdx(qualifiedName: string): number;
get schemaCount(): number;
get schemaToken(): string;
// @internal
setSchemaToken(token: string): void;
}

// @beta (undocumented)
Expand Down Expand Up @@ -2894,6 +2955,12 @@ export namespace SchemaView {
}
}

// @beta
export interface SchemaViewBlob {
readonly data: Uint8Array;
readonly schemaToken: string;
}

// @internal
export class SchemaViewBuilder {
addClass(data: ClassData): number;
Expand All @@ -2907,13 +2974,20 @@ export class SchemaViewBuilder {
addPropertyRef(ref: PropertyRef): void;
addRelConstraint(data: RelConstraintData): number;
addSchema(data: SchemaData): number;
assembleData(): SchemaViewData;
build(schemaToken?: string): SchemaView;
get classCount(): number;
get classMixinCount(): number;
get constraintClassRefCount(): number;
get enumerationCount(): number;
get enumeratorCount(): number;
extendLookupMaps(): void;
getString(sid: number): string;
internString(value: string | undefined): number;
get koqCount(): number;
get propCategoryCount(): number;
get propertyRefCount(): number;
get schemaCount(): number;
updateClass(classIdx: number, data: ClassData): void;
updateSchemaRanges(schemaIdx: number, ranges: {
classRangeStart: number;
Expand Down Expand Up @@ -2969,9 +3043,46 @@ export interface SchemaViewData {
readonly strings: readonly string[];
}

// @beta
export interface SchemaViewDataProvider {
fetchFragmentBlob(schemaNames: readonly string[]): Promise<SchemaViewBlob>;
fetchFullBlob(): Promise<SchemaViewBlob>;
fetchManifest(): Promise<SchemaManifest>;
fetchSchemaToken(): Promise<string>;
}

// @beta
export const schemaViewFormatVersion = 1;

// @beta
export class SchemaViewManager {
constructor(dataProvider: SchemaViewDataProvider);
getSchemaView(args?: GetSchemaViewArgs): Promise<SchemaView>;
invalidateIfChanged(): Promise<void>;
reset(): void;
}

// @internal
export class SchemaViewMergeContext {
// (undocumented)
readonly builder: SchemaViewBuilder;
// (undocumented)
readonly catRowIdToIdx: Map<number, number>;
// (undocumented)
readonly classResolver: Map<string, number>;
// (undocumented)
readonly classRowIdToIdx: Map<number, number>;
// (undocumented)
readonly enumRowIdToIdx: Map<number, number>;
// (undocumented)
readonly koqRowIdToIdx: Map<number, number>;
mergeBlob(data: Uint8Array): void;
// (undocumented)
readonly schemaECIdToIdx: Map<number, number>;
// (undocumented)
readonly schemaNames: string[];
}

// @beta
export enum SchemaViewPrimitiveType {
// (undocumented)
Expand Down
9 changes: 9 additions & 0 deletions common/api/summary/ecschema-metadata.exports.csv
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ preview;class;Format
beta;interface;FormatSet
beta;class;FormatSetFormatsProvider
internal;function;getFormatProps
beta;interface;GetSchemaViewArgs
public;interface;HasMixins
preview;interface;HasMixins
beta;interface;ILocalizationProvider
Expand Down Expand Up @@ -258,6 +259,10 @@ beta;class;SchemaLoader
beta;class;SchemaLocalization
beta;interface;SchemaLocalizationJson
beta;interface;SchemaLocaterOptions
beta;class;SchemaManifest
beta;interface;SchemaManifestEntry
internal;interface;SchemaManifestReferenceRow
internal;interface;SchemaManifestSchemaRow
public;enum;SchemaMatchType
preview;enum;SchemaMatchType
public;class;SchemaPartVisitorDelegate
Expand All @@ -275,9 +280,13 @@ beta;namespace;SchemaView
internal;function;createClass
internal;function;createProperty
internal;function;parseFormatString
beta;interface;SchemaViewBlob
internal;class;SchemaViewBuilder
internal;interface;SchemaViewData
beta;interface;SchemaViewDataProvider
beta;const;schemaViewFormatVersion
beta;class;SchemaViewManager
internal;class;SchemaViewMergeContext
beta;enum;SchemaViewPrimitiveType
internal;class;SchemaWalker
public;enum;StrengthDirection
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"changes": [
{
"packageName": "@itwin/core-backend",
"comment": "Add filtering support to SchemaView and improve performance.",
"type": "none"
}
],
"packageName": "@itwin/core-backend"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"changes": [
{
"packageName": "@itwin/core-frontend",
"comment": "Add filtering support to SchemaView and improve performance.",
"type": "none"
}
],
"packageName": "@itwin/core-frontend"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"changes": [
{
"packageName": "@itwin/ecschema-metadata",
"comment": "Add performance improvements for SchemaView. Filtering by schema, incremental loading, and a common lifetime manager class for invalidation.",
"type": "none"
}
],
"packageName": "@itwin/ecschema-metadata"
}
Loading
Loading