Skip to content
Merged
Show file tree
Hide file tree
Changes from 62 commits
Commits
Show all changes
101 commits
Select commit Hold shift + click to select a range
bae4da3
Initial wrapper implemented
soham-bentley Mar 27, 2026
a708c19
Update
soham-bentley Mar 27, 2026
187f561
Added test
soham-bentley Mar 27, 2026
b8dffb6
Update
soham-bentley Mar 27, 2026
847e536
More updates
soham-bentley Mar 27, 2026
553c98d
Revert "Initial wrapper implemented"
soham-bentley Mar 28, 2026
1412bcd
New api added
soham-bentley Mar 28, 2026
8f2d16a
Update
soham-bentley Mar 29, 2026
06058ad
First working test
soham-bentley Apr 1, 2026
8dbaa56
Update
soham-bentley Apr 2, 2026
ea431c8
Tests updated and implementation consolidated
soham-bentley Apr 3, 2026
d5a84ea
More tests added
soham-bentley Apr 3, 2026
00bbfcc
Added more tests
soham-bentley Apr 3, 2026
a744b01
Final tests pushed
soham-bentley Apr 3, 2026
1d3f5f8
Updated heading test
soham-bentley Apr 3, 2026
748a128
Merge branch 'master' of https://github.com/iTwin/itwinjs-core into s…
soham-bentley Apr 3, 2026
e25d005
Mlore update
soham-bentley Apr 3, 2026
906ff1f
Merge branch 'master' of https://github.com/iTwin/itwinjs-core into s…
soham-bentley Apr 3, 2026
08f30bc
Fixed some comments
soham-bentley Apr 6, 2026
6b6a12d
Removed unnecessary stuff
soham-bentley Apr 6, 2026
c9308da
Splitting files
soham-bentley Apr 6, 2026
90fc9bd
Some lint issues solved
soham-bentley Apr 6, 2026
d2e0549
Final update
soham-bentley Apr 6, 2026
aabbb75
Merge branch 'master' of https://github.com/iTwin/itwinjs-core into s…
soham-bentley Apr 6, 2026
df75b29
Added IsIndirectChanges
soham-bentley Apr 7, 2026
fa49c4a
Updated documentation
soham-bentley Apr 7, 2026
8651fc2
Merge branch 'master' of https://github.com/iTwin/itwinjs-core into s…
soham-bentley Apr 7, 2026
3449f06
Fixed lint errors
soham-bentley Apr 7, 2026
8da2a05
extract-api issues solved and changes pushed
soham-bentley Apr 8, 2026
6a58a7b
More lint issues solved
soham-bentley Apr 8, 2026
8bf2387
Fixed some more issues
soham-bentley Apr 8, 2026
0656b75
Added filtering
soham-bentley Apr 8, 2026
8e905fd
Updated doc
soham-bentley Apr 8, 2026
17a879c
Merge branch 'master' of https://github.com/iTwin/itwinjs-core into s…
soham-bentley Apr 8, 2026
a9fc69b
Added lint deprecated suppression logic for lint
soham-bentley Apr 8, 2026
af8b278
Fixed some more issues
soham-bentley Apr 8, 2026
d4dd31f
Added another test
soham-bentley Apr 9, 2026
25f6070
Added another test
soham-bentley Apr 9, 2026
0d5613c
Added perf tests
soham-bentley Apr 9, 2026
b2cbbbb
Final update
soham-bentley Apr 9, 2026
f70d52f
Modified the tests
soham-bentley Apr 9, 2026
741be82
Merge branch 'master' of https://github.com/iTwin/itwinjs-core into s…
soham-bentley Apr 9, 2026
6226381
removed commented code
soham-bentley Apr 9, 2026
477addd
Added a test for overflow table
soham-bentley Apr 9, 2026
8aba117
extract-api updated
soham-bentley Apr 9, 2026
e85e554
Updated doc and fixed lint error
soham-bentley Apr 9, 2026
b2c03f9
variable names changed from changesetFetchedProps ->changeFetchedProp…
soham-bentley Apr 10, 2026
ff920c7
Docuemntation updated
soham-bentley Apr 10, 2026
64f19eb
remove additional character in comment
rschili Apr 11, 2026
6f6051e
Added more test
soham-bentley Apr 13, 2026
c8c7223
Merge branch 'soham/native-ec-reader' of https://github.com/iTwin/itw…
soham-bentley Apr 13, 2026
0766efa
Comment updated
soham-bentley Apr 13, 2026
bd5c22b
Updated docs and comments
soham-bentley Apr 14, 2026
5efd46d
Fixed some comments
soham-bentley Apr 14, 2026
846c4bf
Fixed comments
soham-bentley Apr 14, 2026
655becc
Lint issues solved
soham-bentley Apr 14, 2026
9701fa0
More update
soham-bentley Apr 14, 2026
3f5d88f
Update
soham-bentley Apr 14, 2026
a6c6c72
Fixed extract-api and build issues
soham-bentley Apr 14, 2026
71e51dc
Update
soham-bentley Apr 14, 2026
671b769
Minor adjustments
soham-bentley Apr 15, 2026
3b60d2e
Update in docs
soham-bentley Apr 15, 2026
d6242a3
Update
soham-bentley Apr 15, 2026
dc2cd05
extract-api changes
soham-bentley Apr 15, 2026
ed5e428
doc updated
soham-bentley Apr 15, 2026
304553f
Comments updated
soham-bentley Apr 15, 2026
774a68f
Merge branch 'master' of https://github.com/iTwin/itwinjs-core into s…
soham-bentley Apr 15, 2026
ca02599
comment update
soham-bentley Apr 15, 2026
8a47228
Merge branch 'master' of https://github.com/iTwin/itwinjs-core into s…
soham-bentley Apr 17, 2026
d082b8c
Changed example code to fix rush cover failures
soham-bentley Apr 17, 2026
3a7aa5b
docs(backend): link ECChangesetReader references for docs site crossrefs
Copilot Apr 17, 2026
c1924f7
All comments fixed
soham-bentley Apr 20, 2026
badd733
Merge branch 'soham/native-ec-reader' of https://github.com/iTwin/itw…
soham-bentley Apr 20, 2026
bd8e649
Docs and lint issues fixed
soham-bentley Apr 20, 2026
ebb2e70
extract-api changes
soham-bentley Apr 20, 2026
473fef9
Merge branch 'master' of https://github.com/iTwin/itwinjs-core into s…
soham-bentley Apr 20, 2026
e869383
copilot comment fixed
soham-bentley Apr 20, 2026
c1508db
Comments updated
soham-bentley Apr 20, 2026
9bb5807
Updated comments
soham-bentley Apr 20, 2026
8917d90
propFilter changed from string to PropertyFilter
soham-bentley Apr 21, 2026
a45536f
Merge branch 'master' of https://github.com/iTwin/itwinjs-core into s…
soham-bentley Apr 21, 2026
513b436
Updated a test
soham-bentley Apr 23, 2026
5ec3bea
Test updates
soham-bentley Apr 23, 2026
9563a27
Merge branch 'master' of https://github.com/iTwin/itwinjs-core into s…
soham-bentley Apr 23, 2026
0c76f31
Update in few tests and docs
soham-bentley Apr 23, 2026
d887dee
Update
soham-bentley Apr 23, 2026
9c031e0
Added one more test
soham-bentley Apr 23, 2026
293dfa2
Updated file names
soham-bentley Apr 23, 2026
617e9ed
Removed change file
soham-bentley Apr 23, 2026
119a460
Added new change log
soham-bentley Apr 23, 2026
4fcc09a
extract-api changes
soham-bentley Apr 23, 2026
52bcf50
Docs updated
soham-bentley Apr 23, 2026
1f1f09a
Update in native api names
soham-bentley Apr 24, 2026
ffe8b7b
Merge branch 'master' of https://github.com/iTwin/itwinjs-core into s…
soham-bentley Apr 24, 2026
fc3ead3
Merge branch 'master' into soham/native-ec-reader
khanaffan Apr 24, 2026
467c1e2
Update in docs
soham-bentley Apr 27, 2026
038d3ab
Merge branch 'soham/native-ec-reader' of https://github.com/iTwin/itw…
soham-bentley Apr 27, 2026
e8e5b6d
Merge branch 'master' of https://github.com/iTwin/itwinjs-core into s…
soham-bentley Apr 27, 2026
0154f64
@bentley/imodeljs-native 5.9.14
imodeljs-admin Apr 27, 2026
098f8cf
Merge branch 'master' of https://github.com/iTwin/itwinjs-core into s…
soham-bentley Apr 27, 2026
6c35882
Merge branch 'soham/native-ec-reader' of https://github.com/iTwin/itw…
soham-bentley Apr 27, 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
17 changes: 17 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -643,6 +643,23 @@
"${workspaceFolder}/full-stack-tests/*/lib/**/*.js"
]
},
{
"name": "[perftests] ECChangesetReader PerfTests (Offline)",
"presentation": {
"group": "Perftests"
},
"cwd": "${workspaceFolder}/full-stack-tests/backend",
"type": "node",
"request": "launch",
"runtimeExecutable": "npm",
"runtimeArgs": [
"run",
"perftest:ecChangesetReaderPerformance"
],
"outFiles": [
"${workspaceFolder}/full-stack-tests/*/lib/**/*.js"
]
},
{
"name": "[perftests] Delete Multiple Relationship Instances (Offline)",
"presentation": {
Expand Down
124 changes: 119 additions & 5 deletions common/api/core-backend.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -850,7 +850,7 @@ export class CategorySelector extends DefinitionElement {
toJSON(): CategorySelectorProps;
}

// @beta
// @beta @deprecated
export interface ChangedECInstance {
// (undocumented)
$meta?: ChangeMetaData;
Expand Down Expand Up @@ -899,7 +899,7 @@ export interface ChangeInstanceKey {
id: Id64String;
}

// @beta
// @beta @deprecated
export interface ChangeMetaData {
changeIndexes: number[];
classFullName?: string;
Expand All @@ -915,7 +915,7 @@ export interface ChangesetArg extends IModelIdArg {
readonly changeset: ChangesetIndexOrId;
}

// @beta
// @beta @deprecated
export class ChangesetECAdaptor implements Disposable {
[Symbol.dispose](): void;
constructor(reader: SqliteChangesetReader, disableMetaData?: boolean);
Expand Down Expand Up @@ -2242,14 +2242,73 @@ export abstract class DriverBundleElement extends InformationContentElement {
}

// @beta
export enum ECChangesetMode {
All_Properties = 0,
Bis_Element_Properties = 1,
Instance_Key = 2
}

// @beta
export class ECChangesetReader implements Disposable, ECNativeChangeSource {
[Symbol.dispose](): void;
clearClassIdFilters(): void;
clearOpCodeFilters(): void;
clearTableNameFilters(): void;
close(): void;
readonly db: AnyDb;
deleted?: ECNativeChangeInstance;
inserted?: ECNativeChangeInstance;
get isECTable(): boolean;
get isIndirectChange(): boolean;
get op(): ECNativeChangeOp;
static openFile(args: {
readonly fileName: string;
} & ECChangesetReaderArgs): ECChangesetReader;
static openGroup(args: {
readonly changesetFiles: string[];
} & ECChangesetReaderArgs): ECChangesetReader;
static openInMemoryChanges(args: Omit<ECChangesetReaderArgs, "db"> & {
db: IModelDb;
}): ECChangesetReader;
static openLocalChanges(args: Omit<ECChangesetReaderArgs, "db"> & {
db: IModelDb;
includeInMemoryChanges?: boolean;
}): ECChangesetReader;
static openTxn(args: Omit<ECChangesetReaderArgs, "db"> & {
db: IModelDb;
txnId: Id64String;
}): ECChangesetReader;
setClassIdFilters(classIds: Set<Id64String>): void;
setOpCodeFilters(ops: Set<ECNativeChangeOp>): void;
setTableNameFilters(tableNames: Set<string>): void;
step(): boolean;
get tableName(): string;
}

// @beta
export interface ECChangesetReaderArgs {
readonly db: AnyDb;
readonly invert?: boolean;
readonly mode?: ECChangesetMode;
readonly rowOptions?: ECChangesetRowAdapterOptions;
}

// @beta
export interface ECChangesetRowAdapterOptions {
abbreviateBlobs?: boolean;
classIdsToClassNames?: boolean;
useJsName?: boolean;
}

// @beta @deprecated
export interface ECChangeUnifierCache extends Disposable {
all(): IterableIterator<ChangedECInstance>;
count(): number;
get(key: string): ChangedECInstance | undefined;
set(key: string, value: ChangedECInstance): void;
}

// @beta (undocumented)
// @beta @deprecated (undocumented)
export namespace ECChangeUnifierCache {
export function createInMemoryCache(): ECChangeUnifierCache;
export function createSqliteBackedCache(db: AnyDb, bufferedReadInstanceSizeInBytes?: number): ECChangeUnifierCache;
Expand Down Expand Up @@ -2326,6 +2385,61 @@ export interface ECEnumValue {
value: number | string;
}

// @beta
export interface ECNativeChangeCache extends Disposable {
all(): IterableIterator<ECNativeChangeInstance>;
count(): number;
get(key: string): ECNativeChangeInstance | undefined;
set(key: string, value: ECNativeChangeInstance): void;
}

// @beta
export interface ECNativeChangeInstance {
$meta: ECNativeChangeMeta;
[key: string]: any;
}

// @beta
export interface ECNativeChangeMeta {
changeFetchedPropNames: string[];
changeIndexes: number[];
isIndirectChange: boolean;
mode: string;
nativeKey: string;
op: ECNativeChangeOp;
rowOptions?: ECChangesetRowAdapterOptions;
stage: ECNativeChangeStage;
tables: string[];
}

// @beta
export type ECNativeChangeOp = "Inserted" | "Updated" | "Deleted";

// @beta
export interface ECNativeChangeSource {
readonly deleted?: ECNativeChangeInstance;
readonly inserted?: ECNativeChangeInstance;
readonly op: ECNativeChangeOp;
}

// @beta
export type ECNativeChangeStage = "Old" | "New";

// @beta (undocumented)
export namespace ECNativeChangeUnifierCache {
export function createInMemoryCache(): ECNativeChangeCache;
export function createSqliteBackedCache(bufferedReadInstanceSizeInBytes?: number): ECNativeChangeCache;
}

// @beta
export class ECNativePartialChangeUnifier implements Disposable {
[Symbol.dispose](): void;
constructor(_cache?: ECNativeChangeCache);
appendFrom(source: ECNativeChangeSource): void;
get instanceCount(): number;
get instances(): IterableIterator<ECNativeChangeInstance>;
}

// @public @preview
export class ECSchemaXmlContext {
constructor();
Expand Down Expand Up @@ -5400,7 +5514,7 @@ export class OrthographicViewDefinition extends SpatialViewDefinition {
// @internal
export function parseTextAnnotationData(json: string | undefined): VersionedJSON<TextAnnotationProps> | undefined;

// @beta
// @beta @deprecated
export class PartialECChangeUnifier implements Disposable {
[Symbol.dispose](): void;
constructor(_db: AnyDb, _cache?: ECChangeUnifierCache);
Expand Down
18 changes: 18 additions & 0 deletions common/api/summary/core-backend.exports.csv
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,15 @@ public;class;CategoryOwnsSubCategories
public;class;CategorySelector
preview;class;CategorySelector
beta;interface;ChangedECInstance
deprecated;interface;ChangedECInstance
internal;class;ChangedElementsDb
beta;interface;ChangeFormatArgs
beta;interface;ChangeInstanceKey
beta;interface;ChangeMetaData
deprecated;interface;ChangeMetaData
public;interface;ChangesetArg
beta;class;ChangesetECAdaptor
deprecated;class;ChangesetECAdaptor
internal;interface;ChangesetIndexArg
public;interface;ChangesetRangeArg
beta;interface;ChangeSummary
Expand Down Expand Up @@ -169,12 +172,26 @@ preview;class;DrawingModel
public;class;DrawingViewDefinition
preview;class;DrawingViewDefinition
beta;class;DriverBundleElement
beta;enum;ECChangesetMode
beta;class;ECChangesetReader
beta;interface;ECChangesetReaderArgs
beta;interface;ECChangesetRowAdapterOptions
beta;interface;ECChangeUnifierCache
deprecated;interface;ECChangeUnifierCache
beta;namespace;ECChangeUnifierCache
deprecated;namespace;ECChangeUnifierCache
public;class;ECDb
public;enum;ECDbOpenMode
public;interface;ECEnumValue
deprecated;interface;ECEnumValue
beta;interface;ECNativeChangeCache
beta;interface;ECNativeChangeInstance
beta;interface;ECNativeChangeMeta
beta;type;ECNativeChangeOp
beta;interface;ECNativeChangeSource
beta;type;ECNativeChangeStage
beta;namespace;ECNativeChangeUnifierCache
beta;class;ECNativePartialChangeUnifier
public;class;ECSchemaXmlContext
preview;class;ECSchemaXmlContext
public;class;ECSqlBinder
Expand Down Expand Up @@ -440,6 +457,7 @@ public;class;OrthographicViewDefinition
preview;class;OrthographicViewDefinition
internal;function;parseTextAnnotationData
beta;class;PartialECChangeUnifier
deprecated;class;PartialECChangeUnifier
public;class;PhysicalElement
preview;class;PhysicalElement
public;class;PhysicalElementAssemblesElements
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"changes": [
{
"packageName": "@itwin/core-backend",
"comment": "Added new ECChangesetReader api(along wit new unifier apis) and deprecated ECChangesetAdaptor apis(including unifier apis)",
"type": "none"
}
],
"packageName": "@itwin/core-backend"
}
11 changes: 7 additions & 4 deletions core/backend/src/BriefcaseManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ interface PatchInstanceKey {
*/
interface ChangedInstanceForSemanticRebase {
isIndirect: boolean;
instance: ChangedECInstance;
instance: ChangedECInstance; // eslint-disable-line @typescript-eslint/no-deprecated
}

/** The argument for patch instances during high level rebase application
Expand Down Expand Up @@ -921,16 +921,19 @@ export class BriefcaseManager {
const reader = SqliteChangesetReader.openTxn({
txnId, db, disableSchemaCheck: true
});
// eslint-disable-next-line @typescript-eslint/no-deprecated
const adaptor = new ChangesetECAdaptor(reader);
// eslint-disable-next-line @typescript-eslint/no-deprecated
using indirectUnifier = new PartialECChangeUnifier(reader.db, ECChangeUnifierCache.createInMemoryCache());
// eslint-disable-next-line @typescript-eslint/no-deprecated
using directUnifier = new PartialECChangeUnifier(reader.db, ECChangeUnifierCache.createInMemoryCache());
while (adaptor.step()) {
if (adaptor.reader.isIndirect)
indirectUnifier.appendFrom(adaptor);
indirectUnifier.appendFrom(adaptor); // eslint-disable-line @typescript-eslint/no-deprecated
else
directUnifier.appendFrom(adaptor);
directUnifier.appendFrom(adaptor); // eslint-disable-line @typescript-eslint/no-deprecated
}
return [...Array.from(directUnifier.instances).map((instance) => ({ isIndirect: false, instance })), ...Array.from(indirectUnifier.instances).map((instance) => ({ isIndirect: true, instance }))];
return [...Array.from(directUnifier.instances).map((instance) => ({ isIndirect: false, instance })), ...Array.from(indirectUnifier.instances).map((instance) => ({ isIndirect: true, instance }))]; // eslint-disable-line @typescript-eslint/no-deprecated
}

/**
Expand Down
13 changes: 12 additions & 1 deletion core/backend/src/ChangesetECAdaptor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ import { Base64EncodedString } from "@itwin/core-common";
import { ECDb } from "./ECDb";
import { _nativeDb } from "./internal/Symbols";

/* eslint-disable @typescript-eslint/no-deprecated */ // This file is marked as deprecated and will be removed subsequently, so we can allow usage of deprecated APIs within it.

interface IClassRef {
classId: Id64String;
classFullName: string;
Expand Down Expand Up @@ -352,6 +354,7 @@ class ECDbMap {
/**
* Record meta data for the change.
* @beta
* @deprecated Use ECNativeChangeMeta from ECChangesetReader instead..
* */
export interface ChangeMetaData {
/** list of tables making up this EC change */
Expand All @@ -371,6 +374,7 @@ export interface ChangeMetaData {
/**
* Represent EC change derived from low level sqlite change
* @beta
* @deprecated Use ECNativeChangeInstance from ECChangesetReader instead.
*/
export interface ChangedECInstance {
// eslint-disable-next-line @typescript-eslint/naming-convention
Expand All @@ -384,6 +388,7 @@ export interface ChangedECInstance {
/**
* Helper function to convert between JS DateTime & SQLite JulianDay values.
* @beta
* @deprecated The DateTime namespace is deprecated and will be removed in a future release.
* */
namespace DateTime {
/**
Expand Down Expand Up @@ -411,6 +416,7 @@ namespace DateTime {
/**
* Represents a cache for unifying EC changes.
* @beta
* @deprecated Use ECNativeChangeCache from ECChangesetReader instead.
*/
export interface ECChangeUnifierCache extends Disposable {
/**
Expand Down Expand Up @@ -439,7 +445,10 @@ export interface ECChangeUnifierCache extends Disposable {
*/
count(): number;
}
/** @beta */
/**
* @beta
* @deprecated Use ECNativeChangeUnifierCache.createInMemoryCache / createSqliteBackedCache instead.
*/
export namespace ECChangeUnifierCache {
/**
* Creates and returns a new in-memory cache for EC change unification.
Expand Down Expand Up @@ -648,6 +657,7 @@ class SqliteBackedInstanceCache implements ECChangeUnifierCache {
* Partial changes is per table and a single instance can
* span multiple tables.
* @beta
* @deprecated Use ECNativePartialChangeUnifier instead..
*/
export class PartialECChangeUnifier implements Disposable {
private _readonly = false;
Expand Down Expand Up @@ -815,6 +825,7 @@ export class PartialECChangeUnifier implements Disposable {
* it is per table while a single instance can span multiple table.
* @note PrimitiveArray and StructArray are not supported types.
* @beta
* @deprecated Use ECChangesetReader instead.
*
*/
export class ChangesetECAdaptor implements Disposable {
Expand Down
Loading
Loading