@itwin/core-backend 5.9.0-dev.4 → 5.9.0-dev.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/cjs/BackendHubAccess.js.map +1 -1
- package/lib/cjs/BackendLoggerCategory.js.map +1 -1
- package/lib/cjs/BisCoreSchema.js.map +1 -1
- package/lib/cjs/BlobContainerService.js.map +1 -1
- package/lib/cjs/BriefcaseManager.js +3 -3
- package/lib/cjs/BriefcaseManager.js.map +1 -1
- package/lib/cjs/CatalogDb.js.map +1 -1
- package/lib/cjs/Category.d.ts +37 -7
- package/lib/cjs/Category.d.ts.map +1 -1
- package/lib/cjs/Category.js +33 -42
- package/lib/cjs/Category.js.map +1 -1
- package/lib/cjs/ChangeSummaryManager.js +2 -2
- package/lib/cjs/ChangeSummaryManager.js.map +1 -1
- package/lib/cjs/ChangedElementsDb.js.map +1 -1
- package/lib/cjs/ChangesetECAdaptor.d.ts.map +1 -1
- package/lib/cjs/ChangesetECAdaptor.js +253 -250
- package/lib/cjs/ChangesetECAdaptor.js.map +1 -1
- package/lib/cjs/ChannelControl.d.ts +29 -0
- package/lib/cjs/ChannelControl.d.ts.map +1 -1
- package/lib/cjs/ChannelControl.js.map +1 -1
- package/lib/cjs/CheckpointManager.js +1 -1
- package/lib/cjs/CheckpointManager.js.map +1 -1
- package/lib/cjs/ClassRegistry.js +5 -5
- package/lib/cjs/ClassRegistry.js.map +1 -1
- package/lib/cjs/CloudSqlite.js.map +1 -1
- package/lib/cjs/CodeService.js.map +1 -1
- package/lib/cjs/CodeSpecs.d.ts +32 -3
- package/lib/cjs/CodeSpecs.d.ts.map +1 -1
- package/lib/cjs/CodeSpecs.js +48 -20
- package/lib/cjs/CodeSpecs.js.map +1 -1
- package/lib/cjs/ConcurrentQuery.js.map +1 -1
- package/lib/cjs/CustomViewState3dCreator.js.map +1 -1
- package/lib/cjs/DevTools.js.map +1 -1
- package/lib/cjs/DisplayStyle.d.ts +18 -3
- package/lib/cjs/DisplayStyle.d.ts.map +1 -1
- package/lib/cjs/DisplayStyle.js +10 -21
- package/lib/cjs/DisplayStyle.js.map +1 -1
- package/lib/cjs/ECDb.js.map +1 -1
- package/lib/cjs/ECSchemaXmlContext.js.map +1 -1
- package/lib/cjs/ECSqlRowExecutor.js.map +1 -1
- package/lib/cjs/ECSqlStatement.js.map +1 -1
- package/lib/cjs/ECSqlSyncReader.js.map +1 -1
- package/lib/cjs/EditTxn.d.ts +262 -0
- package/lib/cjs/EditTxn.d.ts.map +1 -0
- package/lib/cjs/EditTxn.js +548 -0
- package/lib/cjs/EditTxn.js.map +1 -0
- package/lib/cjs/Element.d.ts +74 -5
- package/lib/cjs/Element.d.ts.map +1 -1
- package/lib/cjs/Element.js +63 -75
- package/lib/cjs/Element.js.map +1 -1
- package/lib/cjs/ElementAspect.d.ts +10 -0
- package/lib/cjs/ElementAspect.d.ts.map +1 -1
- package/lib/cjs/ElementAspect.js +21 -12
- package/lib/cjs/ElementAspect.js.map +1 -1
- package/lib/cjs/ElementGraphics.js.map +1 -1
- package/lib/cjs/ElementTreeWalker.d.ts +56 -3
- package/lib/cjs/ElementTreeWalker.d.ts.map +1 -1
- package/lib/cjs/ElementTreeWalker.js +53 -40
- package/lib/cjs/ElementTreeWalker.js.map +1 -1
- package/lib/cjs/Entity.js.map +1 -1
- package/lib/cjs/EntityReferences.js.map +1 -1
- package/lib/cjs/ExportGraphics.js.map +1 -1
- package/lib/cjs/ExternalSource.d.ts +11 -2
- package/lib/cjs/ExternalSource.d.ts.map +1 -1
- package/lib/cjs/ExternalSource.js +10 -8
- package/lib/cjs/ExternalSource.js.map +1 -1
- package/lib/cjs/FontFile.js.map +1 -1
- package/lib/cjs/GeoCoordConfig.js.map +1 -1
- package/lib/cjs/GeographicCRSServices.js.map +1 -1
- package/lib/cjs/GeometrySummary.js +47 -47
- package/lib/cjs/GeometrySummary.js.map +1 -1
- package/lib/cjs/IModelDb.d.ts +66 -22
- package/lib/cjs/IModelDb.d.ts.map +1 -1
- package/lib/cjs/IModelDb.js +182 -296
- package/lib/cjs/IModelDb.js.map +1 -1
- package/lib/cjs/IModelDbFonts.js.map +1 -1
- package/lib/cjs/IModelElementCloneContext.js.map +1 -1
- package/lib/cjs/IModelHost.d.ts +22 -0
- package/lib/cjs/IModelHost.d.ts.map +1 -1
- package/lib/cjs/IModelHost.js +9 -0
- package/lib/cjs/IModelHost.js.map +1 -1
- package/lib/cjs/IModelIncrementalSchemaLocater.js.map +1 -1
- package/lib/cjs/IModelJsFs.js.map +1 -1
- package/lib/cjs/ImageSourceConversion.js.map +1 -1
- package/lib/cjs/IpcHost.js +2 -2
- package/lib/cjs/IpcHost.js.map +1 -1
- package/lib/cjs/LineStyle.d.ts +47 -7
- package/lib/cjs/LineStyle.d.ts.map +1 -1
- package/lib/cjs/LineStyle.js +38 -33
- package/lib/cjs/LineStyle.js.map +1 -1
- package/lib/cjs/LocalHub.js +1 -1
- package/lib/cjs/LocalHub.js.map +1 -1
- package/lib/cjs/LocalhostIpcHost.js.map +1 -1
- package/lib/cjs/LockControl.js.map +1 -1
- package/lib/cjs/Material.d.ts +8 -1
- package/lib/cjs/Material.d.ts.map +1 -1
- package/lib/cjs/Material.js +6 -12
- package/lib/cjs/Material.js.map +1 -1
- package/lib/cjs/Model.d.ts +59 -20
- package/lib/cjs/Model.d.ts.map +1 -1
- package/lib/cjs/Model.js +38 -80
- package/lib/cjs/Model.js.map +1 -1
- package/lib/cjs/NativeAppStorage.js.map +1 -1
- package/lib/cjs/NativeHost.js.map +1 -1
- package/lib/cjs/NavigationRelationship.js.map +1 -1
- package/lib/cjs/PromiseMemoizer.js.map +1 -1
- package/lib/cjs/PropertyStore.js.map +1 -1
- package/lib/cjs/Relationship.d.ts +72 -7
- package/lib/cjs/Relationship.d.ts.map +1 -1
- package/lib/cjs/Relationship.js +39 -21
- package/lib/cjs/Relationship.js.map +1 -1
- package/lib/cjs/RpcBackend.js.map +1 -1
- package/lib/cjs/SQLiteDb.js.map +1 -1
- package/lib/cjs/Schema.js.map +1 -1
- package/lib/cjs/SchemaSync.js +4 -4
- package/lib/cjs/SchemaSync.js.map +1 -1
- package/lib/cjs/SchemaUtils.js.map +1 -1
- package/lib/cjs/SheetIndex.d.ts +9 -0
- package/lib/cjs/SheetIndex.d.ts.map +1 -1
- package/lib/cjs/SheetIndex.js +38 -35
- package/lib/cjs/SheetIndex.js.map +1 -1
- package/lib/cjs/SqliteChangesetReader.js.map +1 -1
- package/lib/cjs/SqliteStatement.js.map +1 -1
- package/lib/cjs/StashManager.js +1 -1
- package/lib/cjs/StashManager.js.map +1 -1
- package/lib/cjs/Texture.d.ts +6 -0
- package/lib/cjs/Texture.d.ts.map +1 -1
- package/lib/cjs/Texture.js +6 -14
- package/lib/cjs/Texture.js.map +1 -1
- package/lib/cjs/TileStorage.js.map +1 -1
- package/lib/cjs/TxnManager.d.ts +5 -5
- package/lib/cjs/TxnManager.d.ts.map +1 -1
- package/lib/cjs/TxnManager.js +23 -7
- package/lib/cjs/TxnManager.js.map +1 -1
- package/lib/cjs/ViewDefinition.d.ts +21 -1
- package/lib/cjs/ViewDefinition.d.ts.map +1 -1
- package/lib/cjs/ViewDefinition.js +27 -66
- package/lib/cjs/ViewDefinition.js.map +1 -1
- package/lib/cjs/ViewStateHydrator.js.map +1 -1
- package/lib/cjs/ViewStore.js.map +1 -1
- package/lib/cjs/annotations/ElementDrivesTextAnnotation.d.ts +14 -6
- package/lib/cjs/annotations/ElementDrivesTextAnnotation.d.ts.map +1 -1
- package/lib/cjs/annotations/ElementDrivesTextAnnotation.js +33 -27
- package/lib/cjs/annotations/ElementDrivesTextAnnotation.js.map +1 -1
- package/lib/cjs/annotations/FrameGeometry.js.map +1 -1
- package/lib/cjs/annotations/LeaderGeometry.js.map +1 -1
- package/lib/cjs/annotations/TextAnnotationElement.d.ts.map +1 -1
- package/lib/cjs/annotations/TextAnnotationElement.js +6 -5
- package/lib/cjs/annotations/TextAnnotationElement.js.map +1 -1
- package/lib/cjs/annotations/TextAnnotationGeometry.js.map +1 -1
- package/lib/cjs/annotations/TextBlockGeometry.js.map +1 -1
- package/lib/cjs/annotations/TextBlockLayout.js.map +1 -1
- package/lib/cjs/assets/IModelChange.02.00.00.ecschema.xml +90 -90
- package/lib/cjs/assets/Settings/Schemas/Base.Schema.json +32 -32
- package/lib/cjs/assets/Settings/Schemas/Gcs.schema.json +27 -27
- package/lib/cjs/assets/Settings/Schemas/Workspace.Schema.json +94 -94
- package/lib/cjs/assets/Settings/backend.setting.json5 +21 -21
- package/lib/cjs/core-backend.d.ts +1 -0
- package/lib/cjs/core-backend.d.ts.map +1 -1
- package/lib/cjs/core-backend.js +1 -0
- package/lib/cjs/core-backend.js.map +1 -1
- package/lib/cjs/domains/FunctionalElements.d.ts +6 -2
- package/lib/cjs/domains/FunctionalElements.d.ts.map +1 -1
- package/lib/cjs/domains/FunctionalElements.js +8 -13
- package/lib/cjs/domains/FunctionalElements.js.map +1 -1
- package/lib/cjs/domains/FunctionalSchema.js.map +1 -1
- package/lib/cjs/domains/GenericElements.d.ts +11 -4
- package/lib/cjs/domains/GenericElements.d.ts.map +1 -1
- package/lib/cjs/domains/GenericElements.js +13 -24
- package/lib/cjs/domains/GenericElements.js.map +1 -1
- package/lib/cjs/domains/GenericSchema.js.map +1 -1
- package/lib/cjs/internal/ChangesetConflictArgs.js.map +1 -1
- package/lib/cjs/internal/ChannelAdmin.d.ts +15 -0
- package/lib/cjs/internal/ChannelAdmin.d.ts.map +1 -1
- package/lib/cjs/internal/ChannelAdmin.js +5 -3
- package/lib/cjs/internal/ChannelAdmin.js.map +1 -1
- package/lib/cjs/internal/ElementLRUCache.js.map +1 -1
- package/lib/cjs/internal/FontFileImpl.js.map +1 -1
- package/lib/cjs/internal/HubMock.js.map +1 -1
- package/lib/cjs/internal/IModelDbFontsImpl.js.map +1 -1
- package/lib/cjs/internal/IntegrityCheck.js.map +1 -1
- package/lib/cjs/internal/NativePlatform.js.map +1 -1
- package/lib/cjs/internal/NoLocks.js.map +1 -1
- package/lib/cjs/internal/OnlineStatus.js.map +1 -1
- package/lib/cjs/internal/ServerBasedLocks.js.map +1 -1
- package/lib/cjs/internal/Symbols.d.ts +4 -0
- package/lib/cjs/internal/Symbols.d.ts.map +1 -1
- package/lib/cjs/internal/Symbols.js +5 -1
- package/lib/cjs/internal/Symbols.js.map +1 -1
- package/lib/cjs/internal/annotations/fields.d.ts +3 -2
- package/lib/cjs/internal/annotations/fields.d.ts.map +1 -1
- package/lib/cjs/internal/annotations/fields.js +7 -6
- package/lib/cjs/internal/annotations/fields.js.map +1 -1
- package/lib/cjs/internal/cross-package.js.map +1 -1
- package/lib/cjs/internal/workspace/SettingsEditorImpl.js.map +1 -1
- package/lib/cjs/internal/workspace/SettingsImpl.js.map +1 -1
- package/lib/cjs/internal/workspace/SettingsSchemasImpl.js.map +1 -1
- package/lib/cjs/internal/workspace/WorkspaceImpl.js.map +1 -1
- package/lib/cjs/internal/workspace/WorkspaceSqliteDb.js.map +1 -1
- package/lib/cjs/rpc/multipart.js.map +1 -1
- package/lib/cjs/rpc/tracing.js.map +1 -1
- package/lib/cjs/rpc/web/logging.js.map +1 -1
- package/lib/cjs/rpc/web/request.js.map +1 -1
- package/lib/cjs/rpc/web/response.js.map +1 -1
- package/lib/cjs/rpc-impl/DevToolsRpcImpl.js.map +1 -1
- package/lib/cjs/rpc-impl/IModelReadRpcImpl.js.map +1 -1
- package/lib/cjs/rpc-impl/IModelTileRpcImpl.js.map +1 -1
- package/lib/cjs/rpc-impl/RpcBriefcaseUtility.d.ts.map +1 -1
- package/lib/cjs/rpc-impl/RpcBriefcaseUtility.js.map +1 -1
- package/lib/cjs/rpc-impl/SnapshotIModelRpcImpl.js.map +1 -1
- package/lib/cjs/workspace/Settings.js.map +1 -1
- package/lib/cjs/workspace/SettingsDb.js.map +1 -1
- package/lib/cjs/workspace/SettingsEditor.js.map +1 -1
- package/lib/cjs/workspace/SettingsSchemas.js.map +1 -1
- package/lib/cjs/workspace/Workspace.js.map +1 -1
- package/lib/cjs/workspace/WorkspaceEditor.js.map +1 -1
- package/lib/esm/BackendHubAccess.js.map +1 -1
- package/lib/esm/BackendLoggerCategory.js.map +1 -1
- package/lib/esm/BisCoreSchema.js.map +1 -1
- package/lib/esm/BlobContainerService.js.map +1 -1
- package/lib/esm/BriefcaseManager.js +3 -3
- package/lib/esm/BriefcaseManager.js.map +1 -1
- package/lib/esm/CatalogDb.js.map +1 -1
- package/lib/esm/Category.d.ts +37 -7
- package/lib/esm/Category.d.ts.map +1 -1
- package/lib/esm/Category.js +33 -42
- package/lib/esm/Category.js.map +1 -1
- package/lib/esm/ChangeSummaryManager.js +2 -2
- package/lib/esm/ChangeSummaryManager.js.map +1 -1
- package/lib/esm/ChangedElementsDb.js.map +1 -1
- package/lib/esm/ChangesetECAdaptor.d.ts.map +1 -1
- package/lib/esm/ChangesetECAdaptor.js +253 -250
- package/lib/esm/ChangesetECAdaptor.js.map +1 -1
- package/lib/esm/ChannelControl.d.ts +29 -0
- package/lib/esm/ChannelControl.d.ts.map +1 -1
- package/lib/esm/ChannelControl.js.map +1 -1
- package/lib/esm/CheckpointManager.js +1 -1
- package/lib/esm/CheckpointManager.js.map +1 -1
- package/lib/esm/ClassRegistry.js +5 -5
- package/lib/esm/ClassRegistry.js.map +1 -1
- package/lib/esm/CloudSqlite.js.map +1 -1
- package/lib/esm/CodeService.js.map +1 -1
- package/lib/esm/CodeSpecs.d.ts +32 -3
- package/lib/esm/CodeSpecs.d.ts.map +1 -1
- package/lib/esm/CodeSpecs.js +49 -21
- package/lib/esm/CodeSpecs.js.map +1 -1
- package/lib/esm/ConcurrentQuery.js.map +1 -1
- package/lib/esm/CustomViewState3dCreator.js.map +1 -1
- package/lib/esm/DevTools.js.map +1 -1
- package/lib/esm/DisplayStyle.d.ts +18 -3
- package/lib/esm/DisplayStyle.d.ts.map +1 -1
- package/lib/esm/DisplayStyle.js +10 -21
- package/lib/esm/DisplayStyle.js.map +1 -1
- package/lib/esm/ECDb.js.map +1 -1
- package/lib/esm/ECSchemaXmlContext.js.map +1 -1
- package/lib/esm/ECSqlRowExecutor.js.map +1 -1
- package/lib/esm/ECSqlStatement.js.map +1 -1
- package/lib/esm/ECSqlSyncReader.js.map +1 -1
- package/lib/esm/EditTxn.d.ts +262 -0
- package/lib/esm/EditTxn.d.ts.map +1 -0
- package/lib/esm/EditTxn.js +543 -0
- package/lib/esm/EditTxn.js.map +1 -0
- package/lib/esm/Element.d.ts +74 -5
- package/lib/esm/Element.d.ts.map +1 -1
- package/lib/esm/Element.js +64 -76
- package/lib/esm/Element.js.map +1 -1
- package/lib/esm/ElementAspect.d.ts +10 -0
- package/lib/esm/ElementAspect.d.ts.map +1 -1
- package/lib/esm/ElementAspect.js +22 -13
- package/lib/esm/ElementAspect.js.map +1 -1
- package/lib/esm/ElementGraphics.js.map +1 -1
- package/lib/esm/ElementTreeWalker.d.ts +56 -3
- package/lib/esm/ElementTreeWalker.d.ts.map +1 -1
- package/lib/esm/ElementTreeWalker.js +53 -40
- package/lib/esm/ElementTreeWalker.js.map +1 -1
- package/lib/esm/Entity.js.map +1 -1
- package/lib/esm/EntityReferences.js.map +1 -1
- package/lib/esm/ExportGraphics.js.map +1 -1
- package/lib/esm/ExternalSource.d.ts +11 -2
- package/lib/esm/ExternalSource.d.ts.map +1 -1
- package/lib/esm/ExternalSource.js +10 -8
- package/lib/esm/ExternalSource.js.map +1 -1
- package/lib/esm/FontFile.js.map +1 -1
- package/lib/esm/GeoCoordConfig.js.map +1 -1
- package/lib/esm/GeographicCRSServices.js.map +1 -1
- package/lib/esm/GeometrySummary.js +47 -47
- package/lib/esm/GeometrySummary.js.map +1 -1
- package/lib/esm/IModelDb.d.ts +66 -22
- package/lib/esm/IModelDb.d.ts.map +1 -1
- package/lib/esm/IModelDb.js +184 -298
- package/lib/esm/IModelDb.js.map +1 -1
- package/lib/esm/IModelDbFonts.js.map +1 -1
- package/lib/esm/IModelElementCloneContext.js.map +1 -1
- package/lib/esm/IModelHost.d.ts +22 -0
- package/lib/esm/IModelHost.d.ts.map +1 -1
- package/lib/esm/IModelHost.js +9 -0
- package/lib/esm/IModelHost.js.map +1 -1
- package/lib/esm/IModelIncrementalSchemaLocater.js.map +1 -1
- package/lib/esm/IModelJsFs.js.map +1 -1
- package/lib/esm/ImageSourceConversion.js.map +1 -1
- package/lib/esm/IpcHost.js +3 -3
- package/lib/esm/IpcHost.js.map +1 -1
- package/lib/esm/LineStyle.d.ts +47 -7
- package/lib/esm/LineStyle.d.ts.map +1 -1
- package/lib/esm/LineStyle.js +38 -33
- package/lib/esm/LineStyle.js.map +1 -1
- package/lib/esm/LocalHub.js +1 -1
- package/lib/esm/LocalHub.js.map +1 -1
- package/lib/esm/LocalhostIpcHost.js.map +1 -1
- package/lib/esm/LockControl.js.map +1 -1
- package/lib/esm/Material.d.ts +8 -1
- package/lib/esm/Material.d.ts.map +1 -1
- package/lib/esm/Material.js +6 -12
- package/lib/esm/Material.js.map +1 -1
- package/lib/esm/Model.d.ts +59 -20
- package/lib/esm/Model.d.ts.map +1 -1
- package/lib/esm/Model.js +39 -81
- package/lib/esm/Model.js.map +1 -1
- package/lib/esm/NativeAppStorage.js.map +1 -1
- package/lib/esm/NativeHost.js.map +1 -1
- package/lib/esm/NavigationRelationship.js.map +1 -1
- package/lib/esm/PromiseMemoizer.js.map +1 -1
- package/lib/esm/PropertyStore.js.map +1 -1
- package/lib/esm/Relationship.d.ts +72 -7
- package/lib/esm/Relationship.d.ts.map +1 -1
- package/lib/esm/Relationship.js +40 -22
- package/lib/esm/Relationship.js.map +1 -1
- package/lib/esm/RpcBackend.js.map +1 -1
- package/lib/esm/SQLiteDb.js.map +1 -1
- package/lib/esm/Schema.js.map +1 -1
- package/lib/esm/SchemaSync.js +5 -5
- package/lib/esm/SchemaSync.js.map +1 -1
- package/lib/esm/SchemaUtils.js.map +1 -1
- package/lib/esm/SheetIndex.d.ts +9 -0
- package/lib/esm/SheetIndex.d.ts.map +1 -1
- package/lib/esm/SheetIndex.js +38 -35
- package/lib/esm/SheetIndex.js.map +1 -1
- package/lib/esm/SqliteChangesetReader.js.map +1 -1
- package/lib/esm/SqliteStatement.js.map +1 -1
- package/lib/esm/StashManager.js +1 -1
- package/lib/esm/StashManager.js.map +1 -1
- package/lib/esm/Texture.d.ts +6 -0
- package/lib/esm/Texture.d.ts.map +1 -1
- package/lib/esm/Texture.js +6 -14
- package/lib/esm/Texture.js.map +1 -1
- package/lib/esm/TileStorage.js.map +1 -1
- package/lib/esm/TxnManager.d.ts +5 -5
- package/lib/esm/TxnManager.d.ts.map +1 -1
- package/lib/esm/TxnManager.js +23 -7
- package/lib/esm/TxnManager.js.map +1 -1
- package/lib/esm/ViewDefinition.d.ts +21 -1
- package/lib/esm/ViewDefinition.d.ts.map +1 -1
- package/lib/esm/ViewDefinition.js +27 -66
- package/lib/esm/ViewDefinition.js.map +1 -1
- package/lib/esm/ViewStateHydrator.js.map +1 -1
- package/lib/esm/ViewStore.js.map +1 -1
- package/lib/esm/annotations/ElementDrivesTextAnnotation.d.ts +14 -6
- package/lib/esm/annotations/ElementDrivesTextAnnotation.d.ts.map +1 -1
- package/lib/esm/annotations/ElementDrivesTextAnnotation.js +33 -27
- package/lib/esm/annotations/ElementDrivesTextAnnotation.js.map +1 -1
- package/lib/esm/annotations/FrameGeometry.js.map +1 -1
- package/lib/esm/annotations/LeaderGeometry.js.map +1 -1
- package/lib/esm/annotations/TextAnnotationElement.d.ts.map +1 -1
- package/lib/esm/annotations/TextAnnotationElement.js +6 -5
- package/lib/esm/annotations/TextAnnotationElement.js.map +1 -1
- package/lib/esm/annotations/TextAnnotationGeometry.js.map +1 -1
- package/lib/esm/annotations/TextBlockGeometry.js.map +1 -1
- package/lib/esm/annotations/TextBlockLayout.js.map +1 -1
- package/lib/esm/core-backend.d.ts +1 -0
- package/lib/esm/core-backend.d.ts.map +1 -1
- package/lib/esm/core-backend.js +1 -0
- package/lib/esm/core-backend.js.map +1 -1
- package/lib/esm/domains/FunctionalElements.d.ts +6 -2
- package/lib/esm/domains/FunctionalElements.d.ts.map +1 -1
- package/lib/esm/domains/FunctionalElements.js +8 -13
- package/lib/esm/domains/FunctionalElements.js.map +1 -1
- package/lib/esm/domains/FunctionalSchema.js.map +1 -1
- package/lib/esm/domains/GenericElements.d.ts +11 -4
- package/lib/esm/domains/GenericElements.d.ts.map +1 -1
- package/lib/esm/domains/GenericElements.js +13 -24
- package/lib/esm/domains/GenericElements.js.map +1 -1
- package/lib/esm/domains/GenericSchema.js.map +1 -1
- package/lib/esm/internal/ChangesetConflictArgs.js.map +1 -1
- package/lib/esm/internal/ChannelAdmin.d.ts +15 -0
- package/lib/esm/internal/ChannelAdmin.d.ts.map +1 -1
- package/lib/esm/internal/ChannelAdmin.js +6 -4
- package/lib/esm/internal/ChannelAdmin.js.map +1 -1
- package/lib/esm/internal/ElementLRUCache.js.map +1 -1
- package/lib/esm/internal/FontFileImpl.js.map +1 -1
- package/lib/esm/internal/HubMock.js.map +1 -1
- package/lib/esm/internal/IModelDbFontsImpl.js.map +1 -1
- package/lib/esm/internal/IntegrityCheck.js.map +1 -1
- package/lib/esm/internal/NativePlatform.js.map +1 -1
- package/lib/esm/internal/NoLocks.js.map +1 -1
- package/lib/esm/internal/OnlineStatus.js.map +1 -1
- package/lib/esm/internal/ServerBasedLocks.js.map +1 -1
- package/lib/esm/internal/Symbols.d.ts +4 -0
- package/lib/esm/internal/Symbols.d.ts.map +1 -1
- package/lib/esm/internal/Symbols.js +4 -0
- package/lib/esm/internal/Symbols.js.map +1 -1
- package/lib/esm/internal/annotations/fields.d.ts +3 -2
- package/lib/esm/internal/annotations/fields.d.ts.map +1 -1
- package/lib/esm/internal/annotations/fields.js +7 -6
- package/lib/esm/internal/annotations/fields.js.map +1 -1
- package/lib/esm/internal/cross-package.js.map +1 -1
- package/lib/esm/internal/workspace/SettingsEditorImpl.js.map +1 -1
- package/lib/esm/internal/workspace/SettingsImpl.js.map +1 -1
- package/lib/esm/internal/workspace/SettingsSchemasImpl.js.map +1 -1
- package/lib/esm/internal/workspace/WorkspaceImpl.js.map +1 -1
- package/lib/esm/internal/workspace/WorkspaceSqliteDb.js.map +1 -1
- package/lib/esm/rpc/multipart.js.map +1 -1
- package/lib/esm/rpc/tracing.js.map +1 -1
- package/lib/esm/rpc/web/logging.js.map +1 -1
- package/lib/esm/rpc/web/request.js.map +1 -1
- package/lib/esm/rpc/web/response.js.map +1 -1
- package/lib/esm/rpc-impl/DevToolsRpcImpl.js.map +1 -1
- package/lib/esm/rpc-impl/IModelReadRpcImpl.js.map +1 -1
- package/lib/esm/rpc-impl/IModelTileRpcImpl.js.map +1 -1
- package/lib/esm/rpc-impl/RpcBriefcaseUtility.d.ts.map +1 -1
- package/lib/esm/rpc-impl/RpcBriefcaseUtility.js.map +1 -1
- package/lib/esm/rpc-impl/SnapshotIModelRpcImpl.js.map +1 -1
- package/lib/esm/test/AdvancedEqual.js.map +1 -1
- package/lib/esm/test/AnnotationTestUtils.js.map +1 -1
- package/lib/esm/test/AttachDb.test.js +11 -11
- package/lib/esm/test/AttachDb.test.js.map +1 -1
- package/lib/esm/test/ElementDrivesElement.test.d.ts +20 -19
- package/lib/esm/test/ElementDrivesElement.test.d.ts.map +1 -1
- package/lib/esm/test/ElementDrivesElement.test.js +134 -119
- package/lib/esm/test/ElementDrivesElement.test.js.map +1 -1
- package/lib/esm/test/ElementLRUCache.test.js.map +1 -1
- package/lib/esm/test/GeometryTestUtil.js.map +1 -1
- package/lib/esm/test/IModelHost.test.js +56 -2
- package/lib/esm/test/IModelHost.test.js.map +1 -1
- package/lib/esm/test/IModelTestUtils.d.ts +23 -23
- package/lib/esm/test/IModelTestUtils.d.ts.map +1 -1
- package/lib/esm/test/IModelTestUtils.js +466 -449
- package/lib/esm/test/IModelTestUtils.js.map +1 -1
- package/lib/esm/test/ImageSourceConversion.test.js.map +1 -1
- package/lib/esm/test/IpcHost.test.js.map +1 -1
- package/lib/esm/test/KnownTestLocations.js.map +1 -1
- package/lib/esm/test/PrintElementTree.js.map +1 -1
- package/lib/esm/test/PropertyDb.test.js +2 -2
- package/lib/esm/test/PropertyDb.test.js.map +1 -1
- package/lib/esm/test/RevisionUtility.js.map +1 -1
- package/lib/esm/test/SchemaUtils.test.js +25 -25
- package/lib/esm/test/SchemaUtils.test.js.map +1 -1
- package/lib/esm/test/SequentialLogMatcher.js.map +1 -1
- package/lib/esm/test/SquashSchemaAndDataChanges.test.js +156 -147
- package/lib/esm/test/SquashSchemaAndDataChanges.test.js.map +1 -1
- package/lib/esm/test/TestChangeSetUtility.d.ts.map +1 -1
- package/lib/esm/test/TestChangeSetUtility.js +11 -7
- package/lib/esm/test/TestChangeSetUtility.js.map +1 -1
- package/lib/esm/test/TestEditTxn.d.ts +8 -0
- package/lib/esm/test/TestEditTxn.d.ts.map +1 -0
- package/lib/esm/test/TestEditTxn.js +34 -0
- package/lib/esm/test/TestEditTxn.js.map +1 -0
- package/lib/esm/test/TestUtils.d.ts +1 -0
- package/lib/esm/test/TestUtils.d.ts.map +1 -1
- package/lib/esm/test/TestUtils.js +8 -1
- package/lib/esm/test/TestUtils.js.map +1 -1
- package/lib/esm/test/annotations/Fields.test.js +135 -143
- package/lib/esm/test/annotations/Fields.test.js.map +1 -1
- package/lib/esm/test/annotations/FrameGeometry.test.js.map +1 -1
- package/lib/esm/test/annotations/LeaderGeometry.test.js.map +1 -1
- package/lib/esm/test/annotations/TextAnnotation.test.js +156 -99
- package/lib/esm/test/annotations/TextAnnotation.test.js.map +1 -1
- package/lib/esm/test/annotations/TextBlock.test.js +5 -3
- package/lib/esm/test/annotations/TextBlock.test.js.map +1 -1
- package/lib/esm/test/assets/IncrementalSchemaLocater/configs/old.config.js.map +1 -1
- package/lib/esm/test/assets/IncrementalSchemaLocater/configs/simple.config.js.map +1 -1
- package/lib/esm/test/categories/Category.test.js +63 -3
- package/lib/esm/test/categories/Category.test.js.map +1 -1
- package/lib/esm/test/codespec/CodeSpec.test.js +88 -5
- package/lib/esm/test/codespec/CodeSpec.test.js.map +1 -1
- package/lib/esm/test/ecdb/CTE.test.js +88 -88
- package/lib/esm/test/ecdb/CTE.test.js.map +1 -1
- package/lib/esm/test/ecdb/ConcurrentQuery.test.js +19 -19
- package/lib/esm/test/ecdb/ConcurrentQuery.test.js.map +1 -1
- package/lib/esm/test/ecdb/ConcurrentQueryLoad.test.js +15 -15
- package/lib/esm/test/ecdb/ConcurrentQueryLoad.test.js.map +1 -1
- package/lib/esm/test/ecdb/ECDb.test.js +72 -72
- package/lib/esm/test/ecdb/ECDb.test.js.map +1 -1
- package/lib/esm/test/ecdb/ECDbTestHelper.js.map +1 -1
- package/lib/esm/test/ecdb/ECSchemaXmlContext.test.js.map +1 -1
- package/lib/esm/test/ecdb/ECSqlAst.test.js +68 -67
- package/lib/esm/test/ecdb/ECSqlAst.test.js.map +1 -1
- package/lib/esm/test/ecdb/ECSqlQuery.test.js +6 -6
- package/lib/esm/test/ecdb/ECSqlQuery.test.js.map +1 -1
- package/lib/esm/test/ecdb/ECSqlStatement.test.js +332 -333
- package/lib/esm/test/ecdb/ECSqlStatement.test.js.map +1 -1
- package/lib/esm/test/ecdb/ECSqlSyncReader.test.js.map +1 -1
- package/lib/esm/test/ecdb/QueryReaders.test.js +47 -44
- package/lib/esm/test/ecdb/QueryReaders.test.js.map +1 -1
- package/lib/esm/test/ecdb/SqliteStatement.test.js +2 -2
- package/lib/esm/test/ecdb/SqliteStatement.test.js.map +1 -1
- package/lib/esm/test/ecsql/dataset/ECSqlDatasets.d.ts.map +1 -1
- package/lib/esm/test/ecsql/dataset/ECSqlDatasets.js +30 -28
- package/lib/esm/test/ecsql/dataset/ECSqlDatasets.js.map +1 -1
- package/lib/esm/test/ecsql/src/ECSqlTestGenerator.js +21 -21
- package/lib/esm/test/ecsql/src/ECSqlTestGenerator.js.map +1 -1
- package/lib/esm/test/ecsql/src/ECSqlTestParser.js.map +1 -1
- package/lib/esm/test/ecsql/src/ECSqlTestRunner.test.js.map +1 -1
- package/lib/esm/test/element/DeleteDefinitionElements.test.js +159 -143
- package/lib/esm/test/element/DeleteDefinitionElements.test.js.map +1 -1
- package/lib/esm/test/element/ElementAspect.test.js +90 -82
- package/lib/esm/test/element/ElementAspect.test.js.map +1 -1
- package/lib/esm/test/element/ElementDependencyGraph.test.d.ts.map +1 -1
- package/lib/esm/test/element/ElementDependencyGraph.test.js +51 -43
- package/lib/esm/test/element/ElementDependencyGraph.test.js.map +1 -1
- package/lib/esm/test/element/ElementRoundTrip.test.js +176 -177
- package/lib/esm/test/element/ElementRoundTrip.test.js.map +1 -1
- package/lib/esm/test/element/ExcludedElements.test.js +2 -2
- package/lib/esm/test/element/ExcludedElements.test.js.map +1 -1
- package/lib/esm/test/element/ExternalSource.test.js +40 -38
- package/lib/esm/test/element/ExternalSource.test.js.map +1 -1
- package/lib/esm/test/element/NullStructArray.test.js +23 -22
- package/lib/esm/test/element/NullStructArray.test.js.map +1 -1
- package/lib/esm/test/element/ProjectInformationRecord.test.js +5 -2
- package/lib/esm/test/element/ProjectInformationRecord.test.js.map +1 -1
- package/lib/esm/test/element/SheetInformationAspect.test.js +43 -11
- package/lib/esm/test/element/SheetInformationAspect.test.js.map +1 -1
- package/lib/esm/test/element/UrlLink.test.js +2 -2
- package/lib/esm/test/element/UrlLink.test.js.map +1 -1
- package/lib/esm/test/font/FontFile.test.js.map +1 -1
- package/lib/esm/test/font/IModelDbFonts.test.js +87 -73
- package/lib/esm/test/font/IModelDbFonts.test.js.map +1 -1
- package/lib/esm/test/hubaccess/ApplyChangeset.test.js +194 -155
- package/lib/esm/test/hubaccess/ApplyChangeset.test.js.map +1 -1
- package/lib/esm/test/hubaccess/BriefcaseManager.test.js +2 -4
- package/lib/esm/test/hubaccess/BriefcaseManager.test.js.map +1 -1
- package/lib/esm/test/hubaccess/CheckpointManager.test.js.map +1 -1
- package/lib/esm/test/hubaccess/Rebase.test.js +369 -303
- package/lib/esm/test/hubaccess/Rebase.test.js.map +1 -1
- package/lib/esm/test/hubaccess/SemanticRebase.test.js +467 -392
- package/lib/esm/test/hubaccess/SemanticRebase.test.js.map +1 -1
- package/lib/esm/test/imageData.js.map +1 -1
- package/lib/esm/test/imodel/Code.test.js +31 -31
- package/lib/esm/test/imodel/Code.test.js.map +1 -1
- package/lib/esm/test/imodel/ElementTreeWalker.test.js +57 -48
- package/lib/esm/test/imodel/ElementTreeWalker.test.js.map +1 -1
- package/lib/esm/test/imodel/GetTextureImage.test.js.map +1 -1
- package/lib/esm/test/imodel/IModel.test.js +463 -388
- package/lib/esm/test/imodel/IModel.test.js.map +1 -1
- package/lib/esm/test/imodel/ProjectExtents.test.js +2 -2
- package/lib/esm/test/imodel/ProjectExtents.test.js.map +1 -1
- package/lib/esm/test/imodel/SchemaXmlImport.test.js +13 -13
- package/lib/esm/test/imodel/SchemaXmlImport.test.js.map +1 -1
- package/lib/esm/test/incrementalSchemaLocater/ECSqlQueries.test.js.map +1 -1
- package/lib/esm/test/incrementalSchemaLocater/IncrementalLoading.test.js.map +1 -1
- package/lib/esm/test/incrementalSchemaLocater/TestContext.d.ts.map +1 -1
- package/lib/esm/test/incrementalSchemaLocater/TestContext.js +2 -2
- package/lib/esm/test/incrementalSchemaLocater/TestContext.js.map +1 -1
- package/lib/esm/test/index.d.ts +1 -0
- package/lib/esm/test/index.d.ts.map +1 -1
- package/lib/esm/test/index.js +1 -0
- package/lib/esm/test/index.js.map +1 -1
- package/lib/esm/test/misc/DevTools.test.js.map +1 -1
- package/lib/esm/test/misc/EntitySubClasses.test.js.map +1 -1
- package/lib/esm/test/misc/GeoServices.test.js.map +1 -1
- package/lib/esm/test/misc/PromiseMemoizer.test.js.map +1 -1
- package/lib/esm/test/native/DgnDbWorker.test.js.map +1 -1
- package/lib/esm/test/rpc/response.test.js.map +1 -1
- package/lib/esm/test/schema/ClassRegistry.test.js +122 -121
- package/lib/esm/test/schema/ClassRegistry.test.js.map +1 -1
- package/lib/esm/test/schema/FunctionalDomain.test.js +36 -34
- package/lib/esm/test/schema/FunctionalDomain.test.js.map +1 -1
- package/lib/esm/test/schema/GenericDomain.test.js +114 -94
- package/lib/esm/test/schema/GenericDomain.test.js.map +1 -1
- package/lib/esm/test/schema/IModelSchemaContext.test.js +11 -10
- package/lib/esm/test/schema/IModelSchemaContext.test.js.map +1 -1
- package/lib/esm/test/schema/SchemaImportCallbacks.test.js +226 -211
- package/lib/esm/test/schema/SchemaImportCallbacks.test.js.map +1 -1
- package/lib/esm/test/sheetindex/SheetIndex.test.d.ts +1 -3
- package/lib/esm/test/sheetindex/SheetIndex.test.d.ts.map +1 -1
- package/lib/esm/test/sheetindex/SheetIndex.test.js +312 -247
- package/lib/esm/test/sheetindex/SheetIndex.test.js.map +1 -1
- package/lib/esm/test/standalone/ChangeMerge.test.js +101 -82
- package/lib/esm/test/standalone/ChangeMerge.test.js.map +1 -1
- package/lib/esm/test/standalone/ChangesetReader.test.js +242 -213
- package/lib/esm/test/standalone/ChangesetReader.test.js.map +1 -1
- package/lib/esm/test/standalone/CustomViewState3dCreator.test.js.map +1 -1
- package/lib/esm/test/standalone/DisplayStyle.test.js +43 -40
- package/lib/esm/test/standalone/DisplayStyle.test.js.map +1 -1
- package/lib/esm/test/standalone/Drawing.test.js +4 -3
- package/lib/esm/test/standalone/Drawing.test.js.map +1 -1
- package/lib/esm/test/standalone/EditTxn.test.d.ts +2 -0
- package/lib/esm/test/standalone/EditTxn.test.d.ts.map +1 -0
- package/lib/esm/test/standalone/EditTxn.test.js +219 -0
- package/lib/esm/test/standalone/EditTxn.test.js.map +1 -0
- package/lib/esm/test/standalone/ElementGraphics.test.js.map +1 -1
- package/lib/esm/test/standalone/ElementMesh.test.js +16 -13
- package/lib/esm/test/standalone/ElementMesh.test.js.map +1 -1
- package/lib/esm/test/standalone/ExportGraphics.test.js +40 -34
- package/lib/esm/test/standalone/ExportGraphics.test.js.map +1 -1
- package/lib/esm/test/standalone/GeometryChangeEvents.test.js +11 -15
- package/lib/esm/test/standalone/GeometryChangeEvents.test.js.map +1 -1
- package/lib/esm/test/standalone/GeometryStream.test.js +212 -165
- package/lib/esm/test/standalone/GeometryStream.test.js.map +1 -1
- package/lib/esm/test/standalone/HubMock.test.js +31 -25
- package/lib/esm/test/standalone/HubMock.test.js.map +1 -1
- package/lib/esm/test/standalone/IModelLimits.test.js +11 -8
- package/lib/esm/test/standalone/IModelLimits.test.js.map +1 -1
- package/lib/esm/test/standalone/IModelWrite.test.d.ts +2 -2
- package/lib/esm/test/standalone/IModelWrite.test.d.ts.map +1 -1
- package/lib/esm/test/standalone/IModelWrite.test.js +211 -169
- package/lib/esm/test/standalone/IModelWrite.test.js.map +1 -1
- package/lib/esm/test/standalone/ITwinWorkspace.test.js.map +1 -1
- package/lib/esm/test/standalone/InlineGeometryPartReferences.test.js +25 -22
- package/lib/esm/test/standalone/InlineGeometryPartReferences.test.js.map +1 -1
- package/lib/esm/test/standalone/IntegrityCheck.test.js +20 -18
- package/lib/esm/test/standalone/IntegrityCheck.test.js.map +1 -1
- package/lib/esm/test/standalone/MergeConflict.test.d.ts +2 -2
- package/lib/esm/test/standalone/MergeConflict.test.d.ts.map +1 -1
- package/lib/esm/test/standalone/MergeConflict.test.js +49 -33
- package/lib/esm/test/standalone/MergeConflict.test.js.map +1 -1
- package/lib/esm/test/standalone/NativeAppStorage.test.js.map +1 -1
- package/lib/esm/test/standalone/RenderMaterialElement.test.js +5 -5
- package/lib/esm/test/standalone/RenderMaterialElement.test.js.map +1 -1
- package/lib/esm/test/standalone/RenderTimeline.test.js +3 -2
- package/lib/esm/test/standalone/RenderTimeline.test.js.map +1 -1
- package/lib/esm/test/standalone/SQLiteDb.test.js.map +1 -1
- package/lib/esm/test/standalone/SchemaUtils.test.js.map +1 -1
- package/lib/esm/test/standalone/SectionDrawing.test.js +7 -7
- package/lib/esm/test/standalone/SectionDrawing.test.js.map +1 -1
- package/lib/esm/test/standalone/ServerBasedLocks.test.js +21 -19
- package/lib/esm/test/standalone/ServerBasedLocks.test.js.map +1 -1
- package/lib/esm/test/standalone/Setting.test.js.map +1 -1
- package/lib/esm/test/standalone/Settings.test.js +7 -4
- package/lib/esm/test/standalone/Settings.test.js.map +1 -1
- package/lib/esm/test/standalone/SettingsSchemas.test.js +2 -1
- package/lib/esm/test/standalone/SettingsSchemas.test.js.map +1 -1
- package/lib/esm/test/standalone/SnapshotDb.test.js +3 -1
- package/lib/esm/test/standalone/SnapshotDb.test.js.map +1 -1
- package/lib/esm/test/standalone/StandaloneDb.test.js +27 -26
- package/lib/esm/test/standalone/StandaloneDb.test.js.map +1 -1
- package/lib/esm/test/standalone/Texture.test.js +5 -4
- package/lib/esm/test/standalone/Texture.test.js.map +1 -1
- package/lib/esm/test/standalone/TileCache.test.d.ts.map +1 -1
- package/lib/esm/test/standalone/TileCache.test.js +5 -3
- package/lib/esm/test/standalone/TileCache.test.js.map +1 -1
- package/lib/esm/test/standalone/TileTree.test.js +35 -31
- package/lib/esm/test/standalone/TileTree.test.js.map +1 -1
- package/lib/esm/test/standalone/TxnManager.test.js +700 -653
- package/lib/esm/test/standalone/TxnManager.test.js.map +1 -1
- package/lib/esm/test/standalone/ViewDefinition.test.js +295 -229
- package/lib/esm/test/standalone/ViewDefinition.test.js.map +1 -1
- package/lib/esm/test/standalone/ViewStoreDb.test.js.map +1 -1
- package/lib/esm/test/standalone/Workspace.test.js +25 -23
- package/lib/esm/test/standalone/Workspace.test.js.map +1 -1
- package/lib/esm/test/standalone/iModelDb.test.js.map +1 -1
- package/lib/esm/test/workspace/SettingsDb.test.js.map +1 -1
- package/lib/esm/workspace/Settings.js.map +1 -1
- package/lib/esm/workspace/SettingsDb.js.map +1 -1
- package/lib/esm/workspace/SettingsEditor.js.map +1 -1
- package/lib/esm/workspace/SettingsSchemas.js.map +1 -1
- package/lib/esm/workspace/Workspace.js.map +1 -1
- package/lib/esm/workspace/WorkspaceEditor.js.map +1 -1
- package/package.json +13 -13
package/lib/esm/IModelDb.js
CHANGED
|
@@ -9,7 +9,7 @@ import * as fs from "fs";
|
|
|
9
9
|
import { join } from "path";
|
|
10
10
|
import * as touch from "touch";
|
|
11
11
|
import { assert, BeEvent, BentleyStatus, ChangeSetStatus, DbChangeStage, DbConflictCause, DbConflictResolution, DbResult, Guid, Id64, IModelStatus, JsonUtils, Logger, LogLevel, LRUMap, OpenMode } from "@itwin/core-bentley";
|
|
12
|
-
import { BriefcaseIdValue, Code, DomainOptions, ECJsNames, ECSqlReader, EntityMetaData, FontMap, IModel, IModelError, IModelNotFoundResponse, ProfileOptions, QueryRowFormat, SchemaState, ViewStoreError, ViewStoreRpc } from "@itwin/core-common";
|
|
12
|
+
import { BriefcaseIdValue, Code, DomainOptions, ECJsNames, ECSqlReader, EditTxnError, EntityMetaData, FontMap, IModel, IModelError, IModelNotFoundResponse, ProfileOptions, QueryRowFormat, SchemaState, ViewStoreError, ViewStoreRpc } from "@itwin/core-common";
|
|
13
13
|
import { Range2d, Range3d } from "@itwin/core-geometry";
|
|
14
14
|
import { BackendLoggerCategory } from "./BackendLoggerCategory";
|
|
15
15
|
import { BriefcaseManager } from "./BriefcaseManager";
|
|
@@ -35,6 +35,7 @@ import { SchemaSync } from "./SchemaSync";
|
|
|
35
35
|
import { createServerBasedLocks } from "./internal/ServerBasedLocks";
|
|
36
36
|
import { SqliteStatement, StatementCache } from "./SqliteStatement";
|
|
37
37
|
import { TxnManager } from "./TxnManager";
|
|
38
|
+
import { EditTxn } from "./EditTxn";
|
|
38
39
|
import { DrawingViewDefinition, SheetViewDefinition, ViewDefinition } from "./ViewDefinition";
|
|
39
40
|
import { ViewStore } from "./ViewStore";
|
|
40
41
|
import { SettingsPriority } from "./workspace/Settings";
|
|
@@ -44,7 +45,7 @@ import { SettingsImpl } from "./internal/workspace/SettingsImpl";
|
|
|
44
45
|
import { IModelNative } from "./internal/NativePlatform";
|
|
45
46
|
import { createNoOpLockControl } from "./internal/NoLocks";
|
|
46
47
|
import { createIModelDbFonts } from "./internal/IModelDbFontsImpl";
|
|
47
|
-
import { _cache, _close, _hubAccess, _instanceKeyCache, _nativeDb, _releaseAllLocks, _resetIModelDb } from "./internal/Symbols";
|
|
48
|
+
import { _activeTxn, _cache, _close, _hubAccess, _implicitTxn, _instanceKeyCache, _nativeDb, _releaseAllLocks, _resetIModelDb } from "./internal/Symbols";
|
|
48
49
|
import { ECVersion, SchemaContext, SchemaJsonLocater } from "@itwin/ecschema-metadata";
|
|
49
50
|
import { SchemaMap } from "./Schema";
|
|
50
51
|
import { ElementLRUCache, InstanceKeyLRUCache } from "./internal/ElementLRUCache";
|
|
@@ -54,6 +55,38 @@ import { integrityCheckTypeMap, performQuickIntegrityCheck, performSpecificInteg
|
|
|
54
55
|
import { ECSqlSyncReader } from "./ECSqlSyncReader";
|
|
55
56
|
// spell:ignore fontid fontmap
|
|
56
57
|
const loggerCategory = BackendLoggerCategory.IModelDb;
|
|
58
|
+
/**
|
|
59
|
+
* Internal write surface used to preserve legacy implicit-transaction mutators while callers migrate to explicit [[EditTxn]] scopes.
|
|
60
|
+
*
|
|
61
|
+
* Unlike an explicit [[EditTxn]], this transaction is always available for writable iModels and cannot be manually started or ended.
|
|
62
|
+
* When implicit-write enforcement is enabled, attempts to write through this transaction are logged or rejected.
|
|
63
|
+
*/
|
|
64
|
+
class ImplicitWriteTxn extends EditTxn {
|
|
65
|
+
constructor(iModel) {
|
|
66
|
+
super(iModel, "implicit");
|
|
67
|
+
}
|
|
68
|
+
start() {
|
|
69
|
+
throw new Error("ImplicitWriteTxn cannot be started");
|
|
70
|
+
}
|
|
71
|
+
end(_mode = "save", _args) {
|
|
72
|
+
throw new Error("ImplicitWriteTxn cannot be ended");
|
|
73
|
+
}
|
|
74
|
+
verifyWriteable() {
|
|
75
|
+
const enforcement = EditTxn.implicitWriteEnforcement;
|
|
76
|
+
if (enforcement === "allow")
|
|
77
|
+
return;
|
|
78
|
+
try {
|
|
79
|
+
EditTxnError.throwError("implicit-txn-write-disallowed", "Implicit transaction write is disallowed. Use an explicit EditTxn instead", this.iModel.key);
|
|
80
|
+
}
|
|
81
|
+
catch (err) {
|
|
82
|
+
if (enforcement === "log") {
|
|
83
|
+
Logger.logError(loggerCategory, err);
|
|
84
|
+
return;
|
|
85
|
+
}
|
|
86
|
+
throw err;
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
}
|
|
57
90
|
/** @internal */
|
|
58
91
|
export var BriefcaseLocalValue;
|
|
59
92
|
(function (BriefcaseLocalValue) {
|
|
@@ -139,6 +172,25 @@ export class IModelDb extends IModel {
|
|
|
139
172
|
_locks = createNoOpLockControl();
|
|
140
173
|
/** @internal */
|
|
141
174
|
_codeService;
|
|
175
|
+
/**
|
|
176
|
+
* The always-available implicit transaction for this iModel.
|
|
177
|
+
*
|
|
178
|
+
* Legacy mutating APIs route through this transaction for backwards compatibility until they are fully migrated to explicit [[EditTxn]] usage.
|
|
179
|
+
* @internal
|
|
180
|
+
*/
|
|
181
|
+
[_implicitTxn];
|
|
182
|
+
/** @internal */
|
|
183
|
+
[_activeTxn];
|
|
184
|
+
/** Returns the active [[EditTxn]] if one is current, otherwise the implicit transaction.
|
|
185
|
+
* Use this inside element and relationship callbacks that may be invoked either during an explicit transaction or
|
|
186
|
+
* during indirect change processing.
|
|
187
|
+
* @note This method is a temporary workaround until [[OnElementArg]] (and related callback arg types) are updated
|
|
188
|
+
* to carry the transaction directly in a future PR.
|
|
189
|
+
* @internal
|
|
190
|
+
*/
|
|
191
|
+
getIndirectTxn() {
|
|
192
|
+
return this[_activeTxn] ?? this[_implicitTxn];
|
|
193
|
+
}
|
|
142
194
|
/** @alpha */
|
|
143
195
|
get codeService() { return this._codeService; }
|
|
144
196
|
/** The [[LockControl]] that orchestrates [concurrent editing]($docs/learning/backend/ConcurrencyControl.md) of this iModel. */
|
|
@@ -227,17 +279,20 @@ export class IModelDb extends IModel {
|
|
|
227
279
|
// Make closeIModel available so their code doesn't break.
|
|
228
280
|
this[_nativeDb].closeIModel = () => {
|
|
229
281
|
if (!this.isReadonly)
|
|
230
|
-
this.saveChanges(); // preserve old behavior of closeIModel that was removed when renamed to closeFile
|
|
282
|
+
this[_nativeDb].saveChanges(); // preserve old behavior of closeIModel that was removed when renamed to closeFile
|
|
283
|
+
this[_activeTxn] = undefined;
|
|
231
284
|
this[_nativeDb].closeFile();
|
|
232
285
|
};
|
|
233
286
|
this[_nativeDb].setIModelDb(this);
|
|
234
287
|
this[_resetIModelDb]();
|
|
235
288
|
IModelDb._openDbs.set(this._fileKey, this);
|
|
289
|
+
this[_implicitTxn] = new ImplicitWriteTxn(this);
|
|
290
|
+
this[_activeTxn] = undefined;
|
|
236
291
|
if (undefined === IModelDb._shutdownListener) { // the first time we create an IModelDb, add a listener to close any orphan files at shutdown.
|
|
237
292
|
IModelDb._shutdownListener = IModelHost.onBeforeShutdown.addListener(() => {
|
|
238
293
|
IModelDb._openDbs.forEach((db) => {
|
|
239
294
|
try {
|
|
240
|
-
db.abandonChanges();
|
|
295
|
+
db[_nativeDb].abandonChanges();
|
|
241
296
|
db.close();
|
|
242
297
|
}
|
|
243
298
|
catch { }
|
|
@@ -267,8 +322,8 @@ export class IModelDb extends IModel {
|
|
|
267
322
|
}
|
|
268
323
|
/**
|
|
269
324
|
* Detach the attached file from this connection. The attached file is closed and its schemas are unregistered.
|
|
270
|
-
* @note There are some
|
|
271
|
-
* @param alias
|
|
325
|
+
* @note There are some reserved table names that cannot be used. They are 'main', 'schema_sync_db', 'ecchange' & 'temp'
|
|
326
|
+
* @param alias identifier that was used in the call to [[attachDb]]
|
|
272
327
|
*
|
|
273
328
|
* @example [[include:IModelDb_attachDb.code]]
|
|
274
329
|
*
|
|
@@ -286,7 +341,13 @@ export class IModelDb extends IModel {
|
|
|
286
341
|
close(options) {
|
|
287
342
|
if (!this.isOpen)
|
|
288
343
|
return; // don't continue if already closed
|
|
344
|
+
// Give the active txn a chance to save or abandon before beforeClose() cleanup runs.
|
|
345
|
+
// StandaloneDb.beforeClose() saves any unsaved changes, so onClose() must run first so
|
|
346
|
+
// subclasses that override onClose() to abandon changes can do so before that save.
|
|
347
|
+
if (!this.isReadonly)
|
|
348
|
+
(this[_activeTxn] ?? this[_implicitTxn]).onClose();
|
|
289
349
|
this.beforeClose();
|
|
350
|
+
this[_activeTxn] = undefined;
|
|
290
351
|
if (options?.optimize)
|
|
291
352
|
this.optimize();
|
|
292
353
|
IModelDb._openDbs.delete(this._fileKey);
|
|
@@ -295,10 +356,20 @@ export class IModelDb extends IModel {
|
|
|
295
356
|
this._locks = undefined;
|
|
296
357
|
this._codeService?.close();
|
|
297
358
|
this._codeService = undefined;
|
|
298
|
-
if (!this.isReadonly)
|
|
299
|
-
this.saveChanges();
|
|
300
359
|
this[_nativeDb].closeFile();
|
|
301
360
|
}
|
|
361
|
+
saveSchemaChanges(args) {
|
|
362
|
+
if (!this[_nativeDb].hasUnsavedChanges())
|
|
363
|
+
return;
|
|
364
|
+
const saveArgs = typeof args === "string" ? { description: args } : args;
|
|
365
|
+
saveArgs === undefined ? this[_nativeDb].saveChanges() : this[_nativeDb].saveChanges(JSON.stringify(saveArgs));
|
|
366
|
+
}
|
|
367
|
+
abandonSchemaChanges() {
|
|
368
|
+
if (!this[_nativeDb].hasUnsavedChanges())
|
|
369
|
+
return;
|
|
370
|
+
this.clearCaches({ instanceCachesOnly: true });
|
|
371
|
+
this[_nativeDb].abandonChanges();
|
|
372
|
+
}
|
|
302
373
|
/** Optimize this iModel by vacuuming, and analyzing.
|
|
303
374
|
*
|
|
304
375
|
* @note This operation requires exclusive access to the database and may take some time on large files.
|
|
@@ -735,10 +806,10 @@ export class IModelDb extends IModel {
|
|
|
735
806
|
* ``` ts
|
|
736
807
|
* [[include:IModelDb.updateProjectExtents]]
|
|
737
808
|
* ```
|
|
809
|
+
* @deprecated Use EditTxn.updateProjectExtents instead, within an explicit EditTxn scope (or via withEditTxn). See EditTxn documentation for migration help.
|
|
738
810
|
*/
|
|
739
811
|
updateProjectExtents(newExtents) {
|
|
740
|
-
this.
|
|
741
|
-
this.updateIModelProps();
|
|
812
|
+
this[_implicitTxn].updateProjectExtents(newExtents);
|
|
742
813
|
}
|
|
743
814
|
/** Compute an appropriate project extents for this iModel based on the ranges of all spatial elements.
|
|
744
815
|
* Typically, the result is simply the union of the ranges of all spatial elements. However, the algorithm also detects "outlier elements",
|
|
@@ -758,45 +829,26 @@ export class IModelDb extends IModel {
|
|
|
758
829
|
outliers: result.outliers,
|
|
759
830
|
};
|
|
760
831
|
}
|
|
761
|
-
/** Update the [EcefLocation]($docs/learning/glossary#eceflocation) of this iModel.
|
|
832
|
+
/** Update the [EcefLocation]($docs/learning/glossary#eceflocation) of this iModel.
|
|
833
|
+
* @deprecated Use EditTxn.updateEcefLocation instead, within an explicit EditTxn scope (or via withEditTxn). See EditTxn documentation for migration help.
|
|
834
|
+
*/
|
|
762
835
|
updateEcefLocation(ecef) {
|
|
763
|
-
this.
|
|
764
|
-
this.updateIModelProps();
|
|
836
|
+
this[_implicitTxn].updateEcefLocation(ecef);
|
|
765
837
|
}
|
|
766
|
-
/** Update the IModelProps of this iModel in the database.
|
|
838
|
+
/** Update the IModelProps of this iModel in the database.
|
|
839
|
+
* @deprecated Use EditTxn.updateIModelProps instead, within an explicit EditTxn scope (or via withEditTxn).
|
|
840
|
+
*/
|
|
767
841
|
updateIModelProps() {
|
|
768
|
-
this[
|
|
842
|
+
this[_implicitTxn].updateIModelProps();
|
|
769
843
|
}
|
|
770
|
-
/** Commit unsaved changes in memory as a Txn to this iModelDb.
|
|
771
|
-
* @internal
|
|
772
|
-
* @param descriptionOrArgs Optionally provide description or [[SaveChangesArgs]] args for the changes.
|
|
773
|
-
* @throws [[IModelError]] if there is a problem saving changes or if there are pending, un-processed lock or code requests.
|
|
774
|
-
* @note This will not push changes to the iModelHub.
|
|
775
|
-
* @note This method should not be called from {TxnManager.withIndirectTxnModeAsync}, {TxnManager.withIndirectTxnMode} or {RebaseHandler.recompute}.
|
|
776
|
-
* @see [[IModelDb.pushChanges]] to push changes to the iModelHub.
|
|
777
|
-
*/
|
|
778
844
|
saveChanges(descriptionOrArgs) {
|
|
779
|
-
|
|
780
|
-
throw new IModelError(IModelStatus.ReadOnly, "IModelDb was opened read-only");
|
|
781
|
-
if (this.isBriefcaseDb()) {
|
|
782
|
-
if (this.txns.isIndirectChanges) {
|
|
783
|
-
throw new IModelError(IModelStatus.BadRequest, "Cannot save changes while in an indirect change scope");
|
|
784
|
-
}
|
|
785
|
-
}
|
|
786
|
-
const args = typeof descriptionOrArgs === "string" ? { description: descriptionOrArgs } : descriptionOrArgs;
|
|
787
|
-
const stat = this[_nativeDb].saveChanges(args ? JSON.stringify(args) : undefined);
|
|
788
|
-
if (DbResult.BE_SQLITE_ERROR_PropagateChangesFailed === stat)
|
|
789
|
-
throw new IModelError(stat, `Could not save changes due to propagation failure.`);
|
|
790
|
-
if (DbResult.BE_SQLITE_OK !== stat)
|
|
791
|
-
throw new IModelError(stat, `Could not save changes (${args?.description})`);
|
|
845
|
+
this[_implicitTxn].saveChanges(descriptionOrArgs);
|
|
792
846
|
}
|
|
793
847
|
/** Abandon changes in memory that have not been saved as a Txn to this iModelDb.
|
|
794
|
-
* @
|
|
848
|
+
* @deprecated Use EditTxn.abandonChanges instead, within an explicit EditTxn scope (or via withEditTxn). See EditTxn documentation for migration help.
|
|
795
849
|
*/
|
|
796
850
|
abandonChanges() {
|
|
797
|
-
|
|
798
|
-
this.clearCaches({ instanceCachesOnly: true });
|
|
799
|
-
this[_nativeDb].abandonChanges();
|
|
851
|
+
this[_implicitTxn].abandonChanges();
|
|
800
852
|
}
|
|
801
853
|
/**
|
|
802
854
|
* Save all changes and perform a [checkpoint](https://www.sqlite.org/c3ref/wal_checkpoint_v2.html) on this IModelDb.
|
|
@@ -808,7 +860,7 @@ export class IModelDb extends IModel {
|
|
|
808
860
|
*/
|
|
809
861
|
performCheckpoint() {
|
|
810
862
|
if (!this.isReadonly) {
|
|
811
|
-
this.saveChanges();
|
|
863
|
+
this[_nativeDb].saveChanges();
|
|
812
864
|
this.clearCaches();
|
|
813
865
|
this[_nativeDb].concurrentQueryShutdown();
|
|
814
866
|
this[_nativeDb].performCheckpoint();
|
|
@@ -847,7 +899,7 @@ export class IModelDb extends IModel {
|
|
|
847
899
|
*
|
|
848
900
|
* If the removal was successful, the database is automatically saved to disk.
|
|
849
901
|
* @param schemaNames Array of schema names to drop
|
|
850
|
-
* @throws [IModelError]
|
|
902
|
+
* @throws [[IModelError]] if the operation fails.
|
|
851
903
|
* @alpha
|
|
852
904
|
*/
|
|
853
905
|
async dropSchemas(schemaNames) {
|
|
@@ -861,11 +913,11 @@ export class IModelDb extends IModel {
|
|
|
861
913
|
await this.acquireSchemaLock();
|
|
862
914
|
try {
|
|
863
915
|
this[_nativeDb].dropSchemas(schemaNames);
|
|
864
|
-
this.
|
|
916
|
+
this.saveSchemaChanges("dropped unused schemas");
|
|
865
917
|
}
|
|
866
918
|
catch (error) {
|
|
867
919
|
Logger.logError(loggerCategory, `Failed to drop schemas: ${error}`);
|
|
868
|
-
this.
|
|
920
|
+
this.abandonSchemaChanges();
|
|
869
921
|
throw new IModelError(DbResult.BE_SQLITE_ERROR, `Failed to drop schemas: ${error}`);
|
|
870
922
|
}
|
|
871
923
|
finally {
|
|
@@ -890,8 +942,9 @@ export class IModelDb extends IModel {
|
|
|
890
942
|
transformStrategy: DataTransformationStrategy.None,
|
|
891
943
|
};
|
|
892
944
|
try {
|
|
893
|
-
|
|
894
|
-
|
|
945
|
+
const preSchemaImportCallback = callback?.preSchemaImportCallback;
|
|
946
|
+
if (preSchemaImportCallback) {
|
|
947
|
+
const callbackResult = await preSchemaImportCallback(context);
|
|
895
948
|
callbackResources.transformStrategy = callbackResult.transformStrategy;
|
|
896
949
|
if (callbackResult.transformStrategy === DataTransformationStrategy.Snapshot) {
|
|
897
950
|
// Create temporary snapshot file
|
|
@@ -904,13 +957,12 @@ export class IModelDb extends IModel {
|
|
|
904
957
|
}
|
|
905
958
|
callbackResources.cachedData = callbackResult.cachedData;
|
|
906
959
|
}
|
|
907
|
-
if (this.isBriefcaseDb() && IModelHost.useSemanticRebase)
|
|
908
|
-
this.
|
|
909
|
-
}
|
|
960
|
+
if (this.isBriefcaseDb() && IModelHost.useSemanticRebase)
|
|
961
|
+
this.saveSchemaChanges("Save changes from schema import pre callback");
|
|
910
962
|
}
|
|
911
963
|
}
|
|
912
964
|
catch (callbackError) {
|
|
913
|
-
this.
|
|
965
|
+
this.abandonSchemaChanges();
|
|
914
966
|
this.cleanupSnapshot(callbackResources);
|
|
915
967
|
throw new IModelError(callbackError.errorNumber ?? IModelStatus.BadRequest, `Failed to execute preSchemaImportCallback: ${callbackError.message}`);
|
|
916
968
|
}
|
|
@@ -924,14 +976,14 @@ export class IModelDb extends IModel {
|
|
|
924
976
|
throw new IModelError(IModelStatus.BadRequest, "InMemory transform strategy requires cachedData to be provided.");
|
|
925
977
|
}
|
|
926
978
|
try {
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
|
|
979
|
+
const postSchemaImportCallback = callback?.postSchemaImportCallback;
|
|
980
|
+
if (postSchemaImportCallback)
|
|
981
|
+
await postSchemaImportCallback(context);
|
|
982
|
+
if (this.isBriefcaseDb() && IModelHost.useSemanticRebase)
|
|
983
|
+
this.saveSchemaChanges("Save changes from schema import post callback");
|
|
932
984
|
}
|
|
933
985
|
catch (callbackError) {
|
|
934
|
-
this.
|
|
986
|
+
this.abandonSchemaChanges();
|
|
935
987
|
throw new IModelError(callbackError.errorNumber ?? IModelStatus.BadRequest, `Failed to execute postSchemaImportCallback: ${callbackError.message}`);
|
|
936
988
|
}
|
|
937
989
|
finally {
|
|
@@ -960,15 +1012,15 @@ export class IModelDb extends IModel {
|
|
|
960
1012
|
}
|
|
961
1013
|
}
|
|
962
1014
|
if (options?.channelUpgrade) {
|
|
1015
|
+
const channelUpgrade = options.channelUpgrade;
|
|
963
1016
|
try {
|
|
964
|
-
await this.channels.upgradeChannel(
|
|
1017
|
+
await this.channels.upgradeChannel(channelUpgrade, this, options.data);
|
|
965
1018
|
// If semantic rebase is enabled and channel upgrade made changes, save them
|
|
966
|
-
if (this.isBriefcaseDb() && IModelHost.useSemanticRebase)
|
|
967
|
-
this.
|
|
968
|
-
}
|
|
1019
|
+
if (this.isBriefcaseDb() && IModelHost.useSemanticRebase)
|
|
1020
|
+
this.saveSchemaChanges();
|
|
969
1021
|
}
|
|
970
1022
|
catch (error) {
|
|
971
|
-
this.
|
|
1023
|
+
this.abandonSchemaChanges();
|
|
972
1024
|
throw error;
|
|
973
1025
|
}
|
|
974
1026
|
}
|
|
@@ -979,13 +1031,13 @@ export class IModelDb extends IModel {
|
|
|
979
1031
|
if (this[_nativeDb].schemaSyncEnabled()) {
|
|
980
1032
|
await SchemaSync.withLockedAccess(this, { openMode: OpenMode.Readonly, operationName: "schema sync" }, async (syncAccess) => {
|
|
981
1033
|
const schemaSyncDbUri = syncAccess.getUri();
|
|
982
|
-
this.
|
|
1034
|
+
this.saveSchemaChanges();
|
|
983
1035
|
try {
|
|
984
1036
|
nativeImportOp(schemas, { schemaLockHeld: false, ecSchemaXmlContext: maybeCustomNativeContext, schemaSyncDbUri });
|
|
985
1037
|
}
|
|
986
1038
|
catch (outerErr) {
|
|
987
1039
|
if (DbResult.BE_SQLITE_ERROR_DataTransformRequired === outerErr.errorNumber) {
|
|
988
|
-
this.
|
|
1040
|
+
this.abandonSchemaChanges();
|
|
989
1041
|
if (this[_nativeDb].getITwinId() !== Guid.empty)
|
|
990
1042
|
await this.acquireSchemaLock();
|
|
991
1043
|
try {
|
|
@@ -1038,13 +1090,16 @@ export class IModelDb extends IModel {
|
|
|
1038
1090
|
if (options?.schemaImportCallbacks?.postSchemaImportCallback)
|
|
1039
1091
|
await this.postSchemaImportCallback(options.schemaImportCallbacks, { iModel: this, resources: preSchemaImportCallbackResult, data: options.data });
|
|
1040
1092
|
}
|
|
1041
|
-
/** Import
|
|
1093
|
+
/** Import ECSchema(s). On success, the schema definition is stored in the iModel.
|
|
1042
1094
|
* This method is asynchronous (must be awaited) because, in the case where this IModelDb is a briefcase, this method first obtains the schema lock from the iModel server.
|
|
1043
1095
|
* You must import a schema into an iModel before you can insert instances of the classes in that schema. See [[Element]]
|
|
1044
|
-
* @param
|
|
1096
|
+
* @param schemaFileNames Files containing serialized ECSchemas.
|
|
1045
1097
|
* @param {SchemaImportOptions} options - options during schema import.
|
|
1046
1098
|
* @throws [[IModelError]] if the schema lock cannot be obtained or there is a problem importing the schema.
|
|
1047
1099
|
* @note Changes are saved if importSchemas is successful and abandoned if not successful.
|
|
1100
|
+
* @note To turn on native logging, use NativeLoggerCategory and a console appender.
|
|
1101
|
+
* - For metadata differences between existing and imported schemas, turn on "ECDb" category.
|
|
1102
|
+
* - For import details, turn on "SchemaImport" category.
|
|
1048
1103
|
* - You can use NativeLoggerCategory to turn on the native logs. You can also control [what exactly is logged by the loggers](https://www.itwinjs.org/learning/common/logging/#controlling-what-is-logged).
|
|
1049
1104
|
* - See [Schema Versioning]($docs/bis/guide/schema-evolution/schema-versioning-and-generations.md) for more information on acceptable changes to schemas.
|
|
1050
1105
|
* @note This method should not be called from {TxnManager.withIndirectTxnModeAsync} or {RebaseHandler.recompute}.
|
|
@@ -1206,7 +1261,7 @@ export class IModelDb extends IModel {
|
|
|
1206
1261
|
return this._jsClassMap;
|
|
1207
1262
|
}
|
|
1208
1263
|
/**
|
|
1209
|
-
* Allows locally registering a schema for this imodel, in
|
|
1264
|
+
* Allows locally registering a schema for this imodel, in contrast to [Schemas.registerSchema] which is a global operation
|
|
1210
1265
|
*/
|
|
1211
1266
|
get schemaMap() {
|
|
1212
1267
|
if (this._schemaMap === undefined)
|
|
@@ -1518,26 +1573,18 @@ export class IModelDb extends IModel {
|
|
|
1518
1573
|
* @param prop the FilePropertyProps that describes the new property
|
|
1519
1574
|
* @param value either a string or a blob to save as the file property
|
|
1520
1575
|
* @note This method should not be called from {TxnManager.withIndirectTxnModeAsync} or {TxnManager.withIndirectTxnMode}.
|
|
1576
|
+
* @deprecated Use EditTxn.saveFileProperty instead, within an explicit EditTxn scope (or via withEditTxn). See EditTxn documentation for migration help.
|
|
1521
1577
|
*/
|
|
1522
1578
|
saveFileProperty(prop, strValue, blobVal) {
|
|
1523
|
-
|
|
1524
|
-
if (this.txns.isIndirectChanges) {
|
|
1525
|
-
throw new IModelError(IModelStatus.BadRequest, "Cannot save file property while in an indirect change scope");
|
|
1526
|
-
}
|
|
1527
|
-
}
|
|
1528
|
-
this[_nativeDb].saveFileProperty(prop, strValue, blobVal);
|
|
1579
|
+
this[_implicitTxn].saveFileProperty(prop, strValue, blobVal);
|
|
1529
1580
|
}
|
|
1530
1581
|
/** delete a "file property" from this iModel
|
|
1531
1582
|
* @param prop the FilePropertyProps that describes the property
|
|
1532
1583
|
* @note This method should not be called from {TxnManager.withIndirectTxnModeAsync} or {TxnManager.withIndirectTxnMode}.
|
|
1584
|
+
* @deprecated Use EditTxn.deleteFileProperty instead, within an explicit EditTxn scope (or via withEditTxn). See EditTxn documentation for migration help.
|
|
1533
1585
|
*/
|
|
1534
1586
|
deleteFileProperty(prop) {
|
|
1535
|
-
|
|
1536
|
-
if (this.txns.isIndirectChanges) {
|
|
1537
|
-
throw new IModelError(IModelStatus.BadRequest, "Cannot delete file property while in an indirect change scope");
|
|
1538
|
-
}
|
|
1539
|
-
}
|
|
1540
|
-
this[_nativeDb].saveFileProperty(prop, undefined, undefined);
|
|
1587
|
+
this[_implicitTxn].deleteFileProperty(prop);
|
|
1541
1588
|
}
|
|
1542
1589
|
/** Query for the next available major id for a "file property" from this iModel.
|
|
1543
1590
|
* @param prop the FilePropertyProps that describes the property
|
|
@@ -1741,28 +1788,17 @@ export class IModelDb extends IModel {
|
|
|
1741
1788
|
* @param name The name for the SettingDictionary. If a dictionary by that name already exists in the iModel, its value is replaced.
|
|
1742
1789
|
* @param dict The SettingDictionary object to stringify and save.
|
|
1743
1790
|
* @note All saved `SettingDictionary`s are loaded into [[workspace.settings]] every time an iModel is opened.
|
|
1744
|
-
* @beta
|
|
1791
|
+
* @beta @deprecated Use EditTxn.saveSettingDictionary instead, within an explicit EditTxn scope (or via withEditTxn). See EditTxn documentation for migration help.
|
|
1745
1792
|
*/
|
|
1746
1793
|
saveSettingDictionary(name, dict) {
|
|
1747
|
-
this.
|
|
1748
|
-
stmt.bindString(1, IModelDb._settingPropNamespace);
|
|
1749
|
-
stmt.bindString(2, name);
|
|
1750
|
-
stmt.bindString(3, JSON.stringify(dict));
|
|
1751
|
-
stmt.stepForWrite();
|
|
1752
|
-
});
|
|
1753
|
-
this.saveChanges("add settings");
|
|
1794
|
+
this[_implicitTxn].saveSettingDictionary(name, dict);
|
|
1754
1795
|
}
|
|
1755
1796
|
/** Delete a SettingDictionary, previously added with [[saveSettingDictionary]], from this iModel.
|
|
1756
1797
|
* @param name The name of the dictionary to delete.
|
|
1757
|
-
* @beta
|
|
1798
|
+
* @beta @deprecated Use EditTxn.deleteSettingDictionary instead, within an explicit EditTxn scope (or via withEditTxn). See EditTxn documentation for migration help.
|
|
1758
1799
|
*/
|
|
1759
1800
|
deleteSettingDictionary(name) {
|
|
1760
|
-
this.
|
|
1761
|
-
stmt.bindString(1, IModelDb._settingPropNamespace);
|
|
1762
|
-
stmt.bindString(2, name);
|
|
1763
|
-
stmt.stepForWrite();
|
|
1764
|
-
});
|
|
1765
|
-
this.saveChanges("delete settings");
|
|
1801
|
+
this[_implicitTxn].deleteSettingDictionary(name);
|
|
1766
1802
|
}
|
|
1767
1803
|
/** Load all setting dictionaries in this iModel into `this.workspace.settings` */
|
|
1768
1804
|
loadIModelSettings() {
|
|
@@ -2037,33 +2073,19 @@ function processSchemaWriteStatus(status) {
|
|
|
2037
2073
|
/** Insert a new model.
|
|
2038
2074
|
* @param props The data for the new model.
|
|
2039
2075
|
* @returns The newly inserted model's Id.
|
|
2040
|
-
* @throws [[IModelError]] if
|
|
2076
|
+
* @throws [[IModelError]] if insertion fails.
|
|
2077
|
+
* @deprecated Use EditTxn.insertModel instead, within an explicit EditTxn scope (or via withEditTxn). See EditTxn documentation for migration help.
|
|
2041
2078
|
*/
|
|
2042
2079
|
insertModel(props) {
|
|
2043
|
-
|
|
2044
|
-
return props.id = this._iModel[_nativeDb].insertModel(props);
|
|
2045
|
-
}
|
|
2046
|
-
catch (err) {
|
|
2047
|
-
const error = new IModelError(err.errorNumber, `Error inserting model [${err.message}], class=${props.classFullName}`);
|
|
2048
|
-
error.cause = err;
|
|
2049
|
-
throw error;
|
|
2050
|
-
}
|
|
2080
|
+
return this._iModel[_implicitTxn].insertModel(props);
|
|
2051
2081
|
}
|
|
2052
2082
|
/** Update an existing model.
|
|
2053
2083
|
* @param props the properties of the model to change
|
|
2054
|
-
* @throws [[IModelError]] if
|
|
2084
|
+
* @throws [[IModelError]] if update fails.
|
|
2085
|
+
* @deprecated Use EditTxn.updateModel instead, within an explicit EditTxn scope (or via withEditTxn). See EditTxn documentation for migration help.
|
|
2055
2086
|
*/
|
|
2056
2087
|
updateModel(props) {
|
|
2057
|
-
|
|
2058
|
-
if (props.id)
|
|
2059
|
-
this[_cache].delete(props.id);
|
|
2060
|
-
this._iModel[_nativeDb].updateModel(props);
|
|
2061
|
-
}
|
|
2062
|
-
catch (err) {
|
|
2063
|
-
const error = new IModelError(err.errorNumber, `Error updating model [${err.message}], id: ${props.id}`);
|
|
2064
|
-
error.cause = err;
|
|
2065
|
-
throw error;
|
|
2066
|
-
}
|
|
2088
|
+
this._iModel[_implicitTxn].updateModel(props);
|
|
2067
2089
|
}
|
|
2068
2090
|
/** Mark the geometry of [[GeometricModel]] as having changed, by recording an indirect change to its GeometryGuid property.
|
|
2069
2091
|
* Typically the GeometryGuid changes automatically when [[GeometricElement]]s within the model are modified, but
|
|
@@ -2071,32 +2093,20 @@ function processSchemaWriteStatus(status) {
|
|
|
2071
2093
|
* [[GeometricElement]]s that reference those definition elements in their geometry streams.
|
|
2072
2094
|
* Cached [Tile]($frontend)s are only invalidated after the geometry guid of the model changes.
|
|
2073
2095
|
* @note This will throw IModelError with [IModelStatus.VersionTooOld]($core-bentley) if a version of the BisCore schema older than 1.0.11 is present in the iModel.
|
|
2074
|
-
* @throws IModelError if
|
|
2096
|
+
* @throws [[IModelError]] if the update fails.
|
|
2097
|
+
* @deprecated Use EditTxn.updateGeometryGuid instead, within an explicit EditTxn scope (or via withEditTxn). See EditTxn documentation for migration help.
|
|
2075
2098
|
* @see [[TxnManager.onModelGeometryChanged]] for the event emitted in response to such a change.
|
|
2076
2099
|
*/
|
|
2077
2100
|
updateGeometryGuid(modelId) {
|
|
2078
|
-
this._iModel
|
|
2079
|
-
const error = this._iModel[_nativeDb].updateModelGeometryGuid(modelId);
|
|
2080
|
-
if (error !== IModelStatus.Success)
|
|
2081
|
-
throw new IModelError(error, `Error updating geometry guid for model ${modelId}`);
|
|
2101
|
+
this._iModel[_implicitTxn].updateGeometryGuid(modelId);
|
|
2082
2102
|
}
|
|
2083
2103
|
/** Delete one or more existing models.
|
|
2084
2104
|
* @param ids The Ids of the models to be deleted
|
|
2085
|
-
* @throws [[IModelError]]
|
|
2105
|
+
* @throws [[IModelError]] if deletion fails.
|
|
2106
|
+
* @deprecated Use EditTxn.deleteModel instead, within an explicit EditTxn scope (or via withEditTxn). See EditTxn documentation for migration help.
|
|
2086
2107
|
*/
|
|
2087
2108
|
deleteModel(ids) {
|
|
2088
|
-
|
|
2089
|
-
try {
|
|
2090
|
-
this[_cache].delete(id);
|
|
2091
|
-
this[_instanceKeyCache].deleteById(id);
|
|
2092
|
-
this._iModel[_nativeDb].deleteModel(id);
|
|
2093
|
-
}
|
|
2094
|
-
catch (err) {
|
|
2095
|
-
const error = new IModelError(err.errorNumber, `Error deleting model [${err.message}], id: ${id}`);
|
|
2096
|
-
error.cause = err;
|
|
2097
|
-
throw error;
|
|
2098
|
-
}
|
|
2099
|
-
});
|
|
2109
|
+
this._iModel[_implicitTxn].deleteModel(ids);
|
|
2100
2110
|
}
|
|
2101
2111
|
/** For each specified [[GeometricModel]], attempts to obtain the union of the volumes of all geometric elements within that model.
|
|
2102
2112
|
* @param ids The Id or Ids of the [[GeometricModel]]s for which to obtain the extents.
|
|
@@ -2314,26 +2324,15 @@ function processSchemaWriteStatus(status) {
|
|
|
2314
2324
|
/** Insert a new element into the iModel.
|
|
2315
2325
|
* @param elProps The properties of the new element.
|
|
2316
2326
|
* @returns The newly inserted element's Id.
|
|
2317
|
-
* @throws [[ITwinError]] if
|
|
2327
|
+
* @throws [[ITwinError]] if insertion fails.
|
|
2318
2328
|
* @note For convenience, the value of `elProps.id` is updated to reflect the resultant element's id.
|
|
2319
2329
|
* However when `elProps.federationGuid` is not present or undefined, a new Guid will be generated and stored on the resultant element. But
|
|
2320
2330
|
* the value of `elProps.federationGuid` is *not* updated. Generally, it is best to re-read the element after inserting (e.g. via [[getElementProps]])
|
|
2321
2331
|
* if you intend to continue working with it. That will ensure its values reflect the persistent state.
|
|
2332
|
+
* @deprecated Use EditTxn.insertElement instead, within an explicit EditTxn scope (or via withEditTxn). See EditTxn documentation for migration help.
|
|
2322
2333
|
*/
|
|
2323
2334
|
insertElement(elProps, options) {
|
|
2324
|
-
|
|
2325
|
-
this[_cache].delete({
|
|
2326
|
-
id: elProps.id,
|
|
2327
|
-
federationGuid: elProps.federationGuid,
|
|
2328
|
-
code: elProps.code,
|
|
2329
|
-
});
|
|
2330
|
-
return elProps.id = this._iModel[_nativeDb].insertElement(elProps, options);
|
|
2331
|
-
}
|
|
2332
|
-
catch (err) {
|
|
2333
|
-
err.message = `Error inserting element [${err.message}]`;
|
|
2334
|
-
err.metadata = { elProps };
|
|
2335
|
-
throw err;
|
|
2336
|
-
}
|
|
2335
|
+
return this._iModel[_implicitTxn].insertElement(elProps, options);
|
|
2337
2336
|
}
|
|
2338
2337
|
/**
|
|
2339
2338
|
* Update some properties of an existing element.
|
|
@@ -2344,126 +2343,33 @@ function processSchemaWriteStatus(status) {
|
|
|
2344
2343
|
* @param elProps the properties of the element to update.
|
|
2345
2344
|
* @note The values of `classFullName` and `model` *may not be changed* by this method. Further, it will permute the `elProps` object by adding or
|
|
2346
2345
|
* overwriting their values to the correct values.
|
|
2347
|
-
* @throws [[ITwinError]] if
|
|
2346
|
+
* @throws [[ITwinError]] if update fails.
|
|
2347
|
+
* @deprecated Use EditTxn.updateElement instead, within an explicit EditTxn scope (or via withEditTxn). See EditTxn documentation for migration help.
|
|
2348
2348
|
*/
|
|
2349
2349
|
updateElement(elProps) {
|
|
2350
|
-
|
|
2351
|
-
if (elProps.id) {
|
|
2352
|
-
this[_instanceKeyCache].deleteById(elProps.id);
|
|
2353
|
-
}
|
|
2354
|
-
else {
|
|
2355
|
-
this[_instanceKeyCache].delete({
|
|
2356
|
-
federationGuid: elProps.federationGuid,
|
|
2357
|
-
code: elProps.code,
|
|
2358
|
-
});
|
|
2359
|
-
}
|
|
2360
|
-
this[_cache].delete({
|
|
2361
|
-
id: elProps.id,
|
|
2362
|
-
federationGuid: elProps.federationGuid,
|
|
2363
|
-
code: elProps.code,
|
|
2364
|
-
});
|
|
2365
|
-
this._iModel[_nativeDb].updateElement(elProps);
|
|
2366
|
-
}
|
|
2367
|
-
catch (err) {
|
|
2368
|
-
err.message = `Error updating element [${err.message}], id: ${elProps.id}`;
|
|
2369
|
-
err.metadata = { elProps };
|
|
2370
|
-
throw err;
|
|
2371
|
-
}
|
|
2350
|
+
this._iModel[_implicitTxn].updateElement(elProps);
|
|
2372
2351
|
}
|
|
2373
2352
|
/** Delete one or more elements from this iModel.
|
|
2374
2353
|
* @param ids The set of Ids of the element(s) to be deleted
|
|
2375
2354
|
* @throws [[ITwinError]]
|
|
2376
2355
|
* @see deleteDefinitionElements
|
|
2356
|
+
* @deprecated Use EditTxn.deleteElement instead, within an explicit EditTxn scope (or via withEditTxn). See EditTxn documentation for migration help.
|
|
2377
2357
|
*/
|
|
2378
2358
|
deleteElement(ids) {
|
|
2379
|
-
|
|
2380
|
-
Id64.toIdSet(ids).forEach((id) => {
|
|
2381
|
-
try {
|
|
2382
|
-
this[_cache].delete({ id });
|
|
2383
|
-
this[_instanceKeyCache].deleteById(id);
|
|
2384
|
-
iModel[_nativeDb].deleteElement(id);
|
|
2385
|
-
}
|
|
2386
|
-
catch (err) {
|
|
2387
|
-
err.message = `Error deleting element [${err.message}], id: ${id}`;
|
|
2388
|
-
err.metadata = { elementId: id };
|
|
2389
|
-
throw err;
|
|
2390
|
-
}
|
|
2391
|
-
});
|
|
2359
|
+
this._iModel[_implicitTxn].deleteElement(ids);
|
|
2392
2360
|
}
|
|
2393
2361
|
/** DefinitionElements can only be deleted if it can be determined that they are not referenced by other Elements.
|
|
2394
2362
|
* This *usage query* can be expensive since it may involve scanning the GeometryStreams of all GeometricElements.
|
|
2395
2363
|
* Since [[deleteElement]] does not perform these additional checks, it fails in order to prevent potentially referenced DefinitionElements from being deleted.
|
|
2396
2364
|
* This method performs those expensive checks and then calls *delete* if not referenced.
|
|
2397
|
-
* @param
|
|
2365
|
+
* @param definitionElementIds The Ids of the DefinitionElements to attempt to delete. To prevent multiple passes over the same GeometricElements, it is best to pass in the entire array of
|
|
2398
2366
|
* DefinitionElements rather than calling this method separately for each one. Ids that are not valid DefinitionElements will be ignored.
|
|
2399
2367
|
* @returns An IdSet of the DefinitionElements that are used and were therefore not deleted.
|
|
2400
2368
|
* @see deleteElement
|
|
2401
|
-
* @
|
|
2369
|
+
* @deprecated Use EditTxn.deleteDefinitionElements instead, within an explicit EditTxn scope (or via withEditTxn). See EditTxn documentation for migration help.
|
|
2402
2370
|
*/
|
|
2403
2371
|
deleteDefinitionElements(definitionElementIds) {
|
|
2404
|
-
|
|
2405
|
-
if (!usageInfo) {
|
|
2406
|
-
throw new IModelError(IModelStatus.BadRequest, "Error querying for DefinitionElement usage");
|
|
2407
|
-
}
|
|
2408
|
-
const usedIdSet = usageInfo.usedIds ? Id64.toIdSet(usageInfo.usedIds) : new Set();
|
|
2409
|
-
const deleteIfUnused = (ids, used) => {
|
|
2410
|
-
if (ids) {
|
|
2411
|
-
ids.forEach((id) => {
|
|
2412
|
-
if (!used.has(id))
|
|
2413
|
-
this._iModel.elements.deleteElement(id);
|
|
2414
|
-
});
|
|
2415
|
-
}
|
|
2416
|
-
};
|
|
2417
|
-
try {
|
|
2418
|
-
this._iModel[_nativeDb].beginPurgeOperation();
|
|
2419
|
-
deleteIfUnused(usageInfo.spatialCategoryIds, usedIdSet);
|
|
2420
|
-
deleteIfUnused(usageInfo.drawingCategoryIds, usedIdSet);
|
|
2421
|
-
deleteIfUnused(usageInfo.viewDefinitionIds, usedIdSet);
|
|
2422
|
-
deleteIfUnused(usageInfo.geometryPartIds, usedIdSet);
|
|
2423
|
-
deleteIfUnused(usageInfo.lineStyleIds, usedIdSet);
|
|
2424
|
-
deleteIfUnused(usageInfo.renderMaterialIds, usedIdSet);
|
|
2425
|
-
deleteIfUnused(usageInfo.subCategoryIds, usedIdSet);
|
|
2426
|
-
deleteIfUnused(usageInfo.textureIds, usedIdSet);
|
|
2427
|
-
deleteIfUnused(usageInfo.displayStyleIds, usedIdSet);
|
|
2428
|
-
deleteIfUnused(usageInfo.categorySelectorIds, usedIdSet);
|
|
2429
|
-
deleteIfUnused(usageInfo.modelSelectorIds, usedIdSet);
|
|
2430
|
-
if (usageInfo.otherDefinitionElementIds) {
|
|
2431
|
-
this._iModel.elements.deleteElement(usageInfo.otherDefinitionElementIds);
|
|
2432
|
-
}
|
|
2433
|
-
}
|
|
2434
|
-
finally {
|
|
2435
|
-
this._iModel[_nativeDb].endPurgeOperation();
|
|
2436
|
-
}
|
|
2437
|
-
if (usageInfo.viewDefinitionIds) {
|
|
2438
|
-
// take another pass in case a deleted ViewDefinition was the only usage of these view-related DefinitionElements
|
|
2439
|
-
let viewRelatedIds = [];
|
|
2440
|
-
if (usageInfo.displayStyleIds)
|
|
2441
|
-
viewRelatedIds = viewRelatedIds.concat(usageInfo.displayStyleIds.filter((id) => usedIdSet.has(id)));
|
|
2442
|
-
if (usageInfo.categorySelectorIds)
|
|
2443
|
-
viewRelatedIds = viewRelatedIds.concat(usageInfo.categorySelectorIds.filter((id) => usedIdSet.has(id)));
|
|
2444
|
-
if (usageInfo.modelSelectorIds)
|
|
2445
|
-
viewRelatedIds = viewRelatedIds.concat(usageInfo.modelSelectorIds.filter((id) => usedIdSet.has(id)));
|
|
2446
|
-
if (viewRelatedIds.length > 0) {
|
|
2447
|
-
const viewRelatedUsageInfo = this._iModel[_nativeDb].queryDefinitionElementUsage(viewRelatedIds);
|
|
2448
|
-
if (viewRelatedUsageInfo) {
|
|
2449
|
-
const usedViewRelatedIdSet = viewRelatedUsageInfo.usedIds ? Id64.toIdSet(viewRelatedUsageInfo.usedIds) : new Set();
|
|
2450
|
-
try {
|
|
2451
|
-
this._iModel[_nativeDb].beginPurgeOperation();
|
|
2452
|
-
deleteIfUnused(viewRelatedUsageInfo.displayStyleIds, usedViewRelatedIdSet);
|
|
2453
|
-
deleteIfUnused(viewRelatedUsageInfo.categorySelectorIds, usedViewRelatedIdSet);
|
|
2454
|
-
deleteIfUnused(viewRelatedUsageInfo.modelSelectorIds, usedViewRelatedIdSet);
|
|
2455
|
-
}
|
|
2456
|
-
finally {
|
|
2457
|
-
this._iModel[_nativeDb].endPurgeOperation();
|
|
2458
|
-
}
|
|
2459
|
-
viewRelatedIds.forEach((id) => {
|
|
2460
|
-
if (!usedViewRelatedIdSet.has(id))
|
|
2461
|
-
usedIdSet.delete(id);
|
|
2462
|
-
});
|
|
2463
|
-
}
|
|
2464
|
-
}
|
|
2465
|
-
}
|
|
2466
|
-
return usedIdSet;
|
|
2372
|
+
return this._iModel[_implicitTxn].deleteDefinitionElements(definitionElementIds);
|
|
2467
2373
|
}
|
|
2468
2374
|
/** Query for the child elements of the specified element.
|
|
2469
2375
|
* @returns Returns an array of child element identifiers.
|
|
@@ -2600,9 +2506,9 @@ function processSchemaWriteStatus(status) {
|
|
|
2600
2506
|
*/
|
|
2601
2507
|
getAspects(elementId, aspectClassFullName, excludedClassFullNames) {
|
|
2602
2508
|
if (aspectClassFullName === undefined) {
|
|
2603
|
-
const allAspects = this.runInstanceQuery(`SELECT $ FROM (
|
|
2604
|
-
SELECT ECInstanceId, ECClassId FROM Bis.ElementMultiAspect WHERE Element.Id = :elementId
|
|
2605
|
-
UNION ALL
|
|
2509
|
+
const allAspects = this.runInstanceQuery(`SELECT $ FROM (
|
|
2510
|
+
SELECT ECInstanceId, ECClassId FROM Bis.ElementMultiAspect WHERE Element.Id = :elementId
|
|
2511
|
+
UNION ALL
|
|
2606
2512
|
SELECT ECInstanceId, ECClassId FROM Bis.ElementUniqueAspect WHERE Element.Id = :elementId) OPTIONS USE_JS_PROP_NAMES DO_NOT_TRUNCATE_BLOB`, elementId, excludedClassFullNames);
|
|
2607
2513
|
if (allAspects.length === 0)
|
|
2608
2514
|
Logger.logInfo(BackendLoggerCategory.ECDb, `No aspects found for class ${aspectClassFullName} and element ${elementId}`);
|
|
@@ -2622,7 +2528,7 @@ function processSchemaWriteStatus(status) {
|
|
|
2622
2528
|
if (classIdList === undefined) {
|
|
2623
2529
|
const classIds = [];
|
|
2624
2530
|
// eslint-disable-next-line @typescript-eslint/no-deprecated
|
|
2625
|
-
this._iModel.withPreparedStatement(`select SourceECInstanceId from meta.ClassHasAllBaseClasses where TargetECInstanceId = (select ECInstanceId from meta.ECClassDef where Name='${fullClassName[1]}'
|
|
2531
|
+
this._iModel.withPreparedStatement(`select SourceECInstanceId from meta.ClassHasAllBaseClasses where TargetECInstanceId = (select ECInstanceId from meta.ECClassDef where Name='${fullClassName[1]}'
|
|
2626
2532
|
and Schema.Id = (select ECInstanceId from meta.ECSchemaDef where Name='${fullClassName[0]}')) and SourceECInstanceId != TargetECInstanceId`,
|
|
2627
2533
|
// eslint-disable-next-line @typescript-eslint/no-deprecated
|
|
2628
2534
|
(statement) => {
|
|
@@ -2639,10 +2545,10 @@ function processSchemaWriteStatus(status) {
|
|
|
2639
2545
|
return [];
|
|
2640
2546
|
}
|
|
2641
2547
|
// Execute an instance query to retrieve all aspects from all the derived classes
|
|
2642
|
-
const aspects = this.runInstanceQuery(`SELECT $ FROM (
|
|
2643
|
-
SELECT ECInstanceId, ECClassId FROM Bis.ElementMultiAspect WHERE Element.Id = :elementId AND ECClassId IN (${classIdList})
|
|
2644
|
-
UNION ALL
|
|
2645
|
-
SELECT ECInstanceId, ECClassId FROM Bis.ElementUniqueAspect WHERE Element.Id = :elementId AND ECClassId IN (${classIdList})
|
|
2548
|
+
const aspects = this.runInstanceQuery(`SELECT $ FROM (
|
|
2549
|
+
SELECT ECInstanceId, ECClassId FROM Bis.ElementMultiAspect WHERE Element.Id = :elementId AND ECClassId IN (${classIdList})
|
|
2550
|
+
UNION ALL
|
|
2551
|
+
SELECT ECInstanceId, ECClassId FROM Bis.ElementUniqueAspect WHERE Element.Id = :elementId AND ECClassId IN (${classIdList})
|
|
2646
2552
|
) OPTIONS USE_JS_PROP_NAMES DO_NOT_TRUNCATE_BLOB`, elementId, excludedClassFullNames);
|
|
2647
2553
|
if (aspects.length === 0)
|
|
2648
2554
|
Logger.logInfo(BackendLoggerCategory.ECDb, `No aspects found for class ${aspectClassFullName} and element ${elementId}`);
|
|
@@ -2654,47 +2560,26 @@ function processSchemaWriteStatus(status) {
|
|
|
2654
2560
|
* @returns the id of the newly inserted aspect.
|
|
2655
2561
|
* @note Aspect Ids may collide with element Ids, so don't put both in a container like Set or Map
|
|
2656
2562
|
* use [EntityReference]($common) for that instead.
|
|
2563
|
+
* @deprecated Use EditTxn.insertAspect instead, within an explicit EditTxn scope (or via withEditTxn). See EditTxn documentation for migration help.
|
|
2657
2564
|
*/
|
|
2658
2565
|
insertAspect(aspectProps) {
|
|
2659
|
-
|
|
2660
|
-
return this._iModel[_nativeDb].insertElementAspect(aspectProps);
|
|
2661
|
-
}
|
|
2662
|
-
catch (err) {
|
|
2663
|
-
const error = new IModelError(err.errorNumber, `Error inserting ElementAspect [${err.message}], class: ${aspectProps.classFullName}`, aspectProps);
|
|
2664
|
-
error.cause = err;
|
|
2665
|
-
throw error;
|
|
2666
|
-
}
|
|
2566
|
+
return this._iModel[_implicitTxn].insertAspect(aspectProps);
|
|
2667
2567
|
}
|
|
2668
2568
|
/** Update an exist ElementAspect within the iModel.
|
|
2669
2569
|
* @param aspectProps The properties to use to update the ElementAspect.
|
|
2670
2570
|
* @throws [[IModelError]] if unable to update the ElementAspect.
|
|
2571
|
+
* @deprecated Use EditTxn.updateAspect instead, within an explicit EditTxn scope (or via withEditTxn). See EditTxn documentation for migration help.
|
|
2671
2572
|
*/
|
|
2672
2573
|
updateAspect(aspectProps) {
|
|
2673
|
-
|
|
2674
|
-
this._iModel[_nativeDb].updateElementAspect(aspectProps);
|
|
2675
|
-
}
|
|
2676
|
-
catch (err) {
|
|
2677
|
-
const error = new IModelError(err.errorNumber, `Error updating ElementAspect [${err.message}], id: ${aspectProps.id}`, aspectProps);
|
|
2678
|
-
error.cause = err;
|
|
2679
|
-
throw error;
|
|
2680
|
-
}
|
|
2574
|
+
this._iModel[_implicitTxn].updateAspect(aspectProps);
|
|
2681
2575
|
}
|
|
2682
2576
|
/** Delete one or more ElementAspects from this iModel.
|
|
2683
2577
|
* @param aspectInstanceIds The set of instance Ids of the ElementAspect(s) to be deleted
|
|
2684
2578
|
* @throws [[IModelError]] if unable to delete the ElementAspect.
|
|
2579
|
+
* @deprecated Use EditTxn.deleteAspect instead, within an explicit EditTxn scope (or via withEditTxn). See EditTxn documentation for migration help.
|
|
2685
2580
|
*/
|
|
2686
2581
|
deleteAspect(aspectInstanceIds) {
|
|
2687
|
-
|
|
2688
|
-
Id64.toIdSet(aspectInstanceIds).forEach((aspectInstanceId) => {
|
|
2689
|
-
try {
|
|
2690
|
-
iModel[_nativeDb].deleteElementAspect(aspectInstanceId);
|
|
2691
|
-
}
|
|
2692
|
-
catch (err) {
|
|
2693
|
-
const error = new IModelError(err.errorNumber, `Error deleting ElementAspect [${err.message}], id: ${aspectInstanceId}`);
|
|
2694
|
-
error.cause = err;
|
|
2695
|
-
throw error;
|
|
2696
|
-
}
|
|
2697
|
-
});
|
|
2582
|
+
this._iModel[_implicitTxn].deleteAspect(aspectInstanceIds);
|
|
2698
2583
|
}
|
|
2699
2584
|
}
|
|
2700
2585
|
IModelDb.Elements = Elements;
|
|
@@ -2737,11 +2622,11 @@ function processSchemaWriteStatus(status) {
|
|
|
2737
2622
|
this._viewStore.container.accessToken = accessToken;
|
|
2738
2623
|
return this._viewStore;
|
|
2739
2624
|
}
|
|
2740
|
-
/**
|
|
2625
|
+
/**
|
|
2626
|
+
* @beta @deprecated Use EditTxn.saveDefaultViewStore instead, within an explicit EditTxn scope (or via withEditTxn). See EditTxn documentation for migration help.
|
|
2627
|
+
*/
|
|
2741
2628
|
saveDefaultViewStore(arg) {
|
|
2742
|
-
|
|
2743
|
-
this._iModel.saveFileProperty(Views.viewStoreProperty, JSON.stringify(props));
|
|
2744
|
-
this._iModel.saveChanges("update default ViewStore");
|
|
2629
|
+
this._iModel[_implicitTxn].saveDefaultViewStore(arg);
|
|
2745
2630
|
}
|
|
2746
2631
|
/** Query for the array of ViewDefinitionProps of the specified class and matching the specified IsPrivate setting.
|
|
2747
2632
|
* @param className Query for view definitions of this class.
|
|
@@ -2884,7 +2769,7 @@ function processSchemaWriteStatus(status) {
|
|
|
2884
2769
|
blob32[0] = Id64.getLowerUint32(viewId);
|
|
2885
2770
|
blob32[1] = Id64.getUpperUint32(viewId);
|
|
2886
2771
|
const blob8 = new Uint8Array(blob32.buffer);
|
|
2887
|
-
this._iModel.saveFileProperty(spec, undefined, blob8);
|
|
2772
|
+
this._iModel[_implicitTxn].saveFileProperty(spec, undefined, blob8);
|
|
2888
2773
|
}
|
|
2889
2774
|
}
|
|
2890
2775
|
IModelDb.Views = Views;
|
|
@@ -3088,7 +2973,7 @@ export class BriefcaseDb extends IModelDb {
|
|
|
3088
2973
|
executeUpgrade();
|
|
3089
2974
|
await withBriefcaseDb(briefcase, async (db) => {
|
|
3090
2975
|
db[_nativeDb].schemaSyncPush(schemaSyncDbUri);
|
|
3091
|
-
db.saveChanges();
|
|
2976
|
+
db[_nativeDb].saveChanges();
|
|
3092
2977
|
});
|
|
3093
2978
|
syncAccess.synchronizeWithCloud();
|
|
3094
2979
|
});
|
|
@@ -3453,7 +3338,7 @@ export class BriefcaseDb extends IModelDb {
|
|
|
3453
3338
|
}
|
|
3454
3339
|
try {
|
|
3455
3340
|
await BriefcaseManager.revertTimelineChanges(this, arg);
|
|
3456
|
-
this.saveChanges("Revert changes");
|
|
3341
|
+
this[_nativeDb].saveChanges("Revert changes");
|
|
3457
3342
|
if (!arg.description) {
|
|
3458
3343
|
arg.description = `Reverted changes from ${this.changeset.index} to ${arg.toIndex}${arg.skipSchemaChanges ? " (schema changes skipped)" : ""}`;
|
|
3459
3344
|
}
|
|
@@ -3476,7 +3361,7 @@ export class BriefcaseDb extends IModelDb {
|
|
|
3476
3361
|
}
|
|
3477
3362
|
}
|
|
3478
3363
|
finally {
|
|
3479
|
-
this.abandonChanges();
|
|
3364
|
+
this[_nativeDb].abandonChanges();
|
|
3480
3365
|
}
|
|
3481
3366
|
}
|
|
3482
3367
|
/**
|
|
@@ -3506,7 +3391,7 @@ export class BriefcaseDb extends IModelDb {
|
|
|
3506
3391
|
}
|
|
3507
3392
|
close(options) {
|
|
3508
3393
|
if (this.isBriefcase && this.isOpen && !this.isReadonly && this.txns.rebaser.inProgress()) {
|
|
3509
|
-
this.abandonChanges();
|
|
3394
|
+
this[_nativeDb].abandonChanges();
|
|
3510
3395
|
}
|
|
3511
3396
|
super.close(options);
|
|
3512
3397
|
this.onClosed.raiseEvent();
|
|
@@ -3723,7 +3608,7 @@ export class SnapshotDb extends IModelDb {
|
|
|
3723
3608
|
throw new IModelError(IModelStatus.SQLiteError, "Error creating class views");
|
|
3724
3609
|
}
|
|
3725
3610
|
else {
|
|
3726
|
-
this.saveChanges();
|
|
3611
|
+
this[_nativeDb].saveChanges();
|
|
3727
3612
|
}
|
|
3728
3613
|
}
|
|
3729
3614
|
}
|
|
@@ -3753,15 +3638,16 @@ export class StandaloneDb extends BriefcaseDb {
|
|
|
3753
3638
|
}
|
|
3754
3639
|
/**
|
|
3755
3640
|
* @internal
|
|
3756
|
-
* Called during close of the
|
|
3641
|
+
* Called during close of the StandaloneDb. It will delete any pending txns.
|
|
3757
3642
|
*/
|
|
3758
3643
|
beforeClose() {
|
|
3759
3644
|
super.beforeClose();
|
|
3760
|
-
if (
|
|
3761
|
-
|
|
3762
|
-
|
|
3763
|
-
|
|
3764
|
-
|
|
3645
|
+
if (this.isReadonly || !this.txns.hasLocalChanges)
|
|
3646
|
+
return;
|
|
3647
|
+
const nativeDb = this[_nativeDb];
|
|
3648
|
+
nativeDb.saveChanges();
|
|
3649
|
+
nativeDb.deleteAllTxns();
|
|
3650
|
+
nativeDb.saveChanges();
|
|
3765
3651
|
}
|
|
3766
3652
|
static tryFindByKey(key) {
|
|
3767
3653
|
const db = super.tryFindByKey(key);
|
|
@@ -3817,7 +3703,7 @@ export class StandaloneDb extends BriefcaseDb {
|
|
|
3817
3703
|
if (BentleyStatus.SUCCESS !== result)
|
|
3818
3704
|
throw new IModelError(result, "Error creating class views");
|
|
3819
3705
|
else
|
|
3820
|
-
this.saveChanges();
|
|
3706
|
+
this[_nativeDb].saveChanges();
|
|
3821
3707
|
}
|
|
3822
3708
|
/** Open a standalone iModel file.
|
|
3823
3709
|
* @param filePath The path of the standalone iModel file.
|