@itwin/core-backend 5.13.0-dev.2 → 5.13.0-dev.21
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +50 -1
- 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.d.ts.map +1 -1
- package/lib/cjs/BriefcaseManager.js +11 -5
- package/lib/cjs/BriefcaseManager.js.map +1 -1
- package/lib/cjs/CatalogDb.js.map +1 -1
- package/lib/cjs/Category.d.ts +4 -4
- 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 +5 -0
- package/lib/cjs/ChangesetECAdaptor.d.ts.map +1 -1
- package/lib/cjs/ChangesetECAdaptor.js +261 -251
- package/lib/cjs/ChangesetECAdaptor.js.map +1 -1
- package/lib/cjs/ChangesetReader.js +3 -3
- package/lib/cjs/ChangesetReader.js.map +1 -1
- package/lib/cjs/ChangesetReaderTypes.js.map +1 -1
- package/lib/cjs/ChannelControl.js.map +1 -1
- package/lib/cjs/CheckpointManager.d.ts +3 -0
- package/lib/cjs/CheckpointManager.d.ts.map +1 -1
- package/lib/cjs/CheckpointManager.js +8 -2
- package/lib/cjs/CheckpointManager.js.map +1 -1
- package/lib/cjs/ClassRegistry.js +10 -10
- package/lib/cjs/ClassRegistry.js.map +1 -1
- package/lib/cjs/CloudSqlite.d.ts.map +1 -1
- package/lib/cjs/CloudSqlite.js +28 -10
- package/lib/cjs/CloudSqlite.js.map +1 -1
- package/lib/cjs/CodeService.js.map +1 -1
- package/lib/cjs/CodeSpecs.d.ts +3 -3
- 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 +2 -2
- package/lib/cjs/DisplayStyle.js.map +1 -1
- package/lib/cjs/ECDb.d.ts.map +1 -1
- package/lib/cjs/ECDb.js +1 -0
- 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.map +1 -1
- package/lib/cjs/EditTxn.js +1 -0
- package/lib/cjs/EditTxn.js.map +1 -1
- package/lib/cjs/Element.d.ts +48 -12
- package/lib/cjs/Element.d.ts.map +1 -1
- package/lib/cjs/Element.js +120 -24
- package/lib/cjs/Element.js.map +1 -1
- package/lib/cjs/ElementAspect.js.map +1 -1
- package/lib/cjs/ElementGraphics.js.map +1 -1
- package/lib/cjs/ElementTreeWalker.js.map +1 -1
- package/lib/cjs/Entity.js.map +1 -1
- package/lib/cjs/EntityReferences.js +2 -2
- package/lib/cjs/EntityReferences.js.map +1 -1
- package/lib/cjs/ExportGraphics.js.map +1 -1
- 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 +118 -30
- package/lib/cjs/IModelDb.d.ts.map +1 -1
- package/lib/cjs/IModelDb.js +325 -115
- 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.map +1 -1
- package/lib/cjs/IModelHost.js +3 -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.map +1 -1
- 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.js.map +1 -1
- package/lib/cjs/Model.d.ts +5 -5
- package/lib/cjs/Model.d.ts.map +1 -1
- 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/PartialChangeUnifier.js +7 -7
- package/lib/cjs/PartialChangeUnifier.js.map +1 -1
- package/lib/cjs/PromiseMemoizer.js.map +1 -1
- package/lib/cjs/PropertyStore.js +1 -1
- package/lib/cjs/PropertyStore.js.map +1 -1
- 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.d.ts +158 -22
- package/lib/cjs/SchemaSync.d.ts.map +1 -1
- package/lib/cjs/SchemaSync.js +417 -76
- package/lib/cjs/SchemaSync.js.map +1 -1
- package/lib/cjs/SchemaUtils.js.map +1 -1
- 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.map +1 -1
- package/lib/cjs/SynchronousChannel.d.ts +62 -0
- package/lib/cjs/SynchronousChannel.d.ts.map +1 -0
- package/lib/cjs/SynchronousChannel.js +11 -0
- package/lib/cjs/SynchronousChannel.js.map +1 -0
- package/lib/cjs/Texture.d.ts +1 -1
- package/lib/cjs/Texture.js.map +1 -1
- package/lib/cjs/TileStorage.js.map +1 -1
- package/lib/cjs/TxnManager.d.ts +44 -4
- package/lib/cjs/TxnManager.d.ts.map +1 -1
- package/lib/cjs/TxnManager.js +74 -19
- package/lib/cjs/TxnManager.js.map +1 -1
- package/lib/cjs/ViewDefinition.d.ts +6 -6
- package/lib/cjs/ViewDefinition.d.ts.map +1 -1
- 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.js.map +1 -1
- package/lib/cjs/annotations/FrameGeometry.js.map +1 -1
- package/lib/cjs/annotations/LeaderGeometry.d.ts +22 -7
- package/lib/cjs/annotations/LeaderGeometry.d.ts.map +1 -1
- package/lib/cjs/annotations/LeaderGeometry.js +104 -36
- package/lib/cjs/annotations/LeaderGeometry.js.map +1 -1
- package/lib/cjs/annotations/TextAnnotationElement.d.ts +1 -1
- package/lib/cjs/annotations/TextAnnotationElement.d.ts.map +1 -1
- package/lib/cjs/annotations/TextAnnotationElement.js +25 -10
- 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 +36 -36
- package/lib/cjs/assets/Settings/Schemas/Gcs.schema.json +28 -28
- 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.js.map +1 -1
- package/lib/cjs/domains/FunctionalSchema.js.map +1 -1
- 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.js.map +1 -1
- package/lib/cjs/internal/ECSqlInstanceReshaper.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.d.ts +22 -0
- package/lib/cjs/internal/IntegrityCheck.d.ts.map +1 -1
- package/lib/cjs/internal/IntegrityCheck.js +13 -0
- 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/NoReservations.d.ts +6 -0
- package/lib/cjs/internal/NoReservations.d.ts.map +1 -0
- package/lib/cjs/internal/NoReservations.js +21 -0
- package/lib/cjs/internal/NoReservations.js.map +1 -0
- package/lib/cjs/internal/OnlineStatus.js.map +1 -1
- package/lib/cjs/internal/SchemaSyncReservations.d.ts +4 -0
- package/lib/cjs/internal/SchemaSyncReservations.d.ts.map +1 -0
- package/lib/cjs/internal/SchemaSyncReservations.js +128 -0
- package/lib/cjs/internal/SchemaSyncReservations.js.map +1 -0
- package/lib/cjs/internal/ServerBasedLocks.js +33 -33
- package/lib/cjs/internal/ServerBasedLocks.js.map +1 -1
- package/lib/cjs/internal/Symbols.d.ts +1 -0
- package/lib/cjs/internal/Symbols.d.ts.map +1 -1
- package/lib/cjs/internal/Symbols.js +2 -1
- package/lib/cjs/internal/Symbols.js.map +1 -1
- 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.d.ts.map +1 -1
- package/lib/cjs/internal/workspace/WorkspaceImpl.js +7 -2
- 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.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.d.ts.map +1 -1
- package/lib/esm/BriefcaseManager.js +11 -5
- package/lib/esm/BriefcaseManager.js.map +1 -1
- package/lib/esm/CatalogDb.js.map +1 -1
- package/lib/esm/Category.d.ts +4 -4
- 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 +5 -0
- package/lib/esm/ChangesetECAdaptor.d.ts.map +1 -1
- package/lib/esm/ChangesetECAdaptor.js +261 -251
- package/lib/esm/ChangesetECAdaptor.js.map +1 -1
- package/lib/esm/ChangesetReader.js +3 -3
- package/lib/esm/ChangesetReader.js.map +1 -1
- package/lib/esm/ChangesetReaderTypes.js.map +1 -1
- package/lib/esm/ChannelControl.js.map +1 -1
- package/lib/esm/CheckpointManager.d.ts +3 -0
- package/lib/esm/CheckpointManager.d.ts.map +1 -1
- package/lib/esm/CheckpointManager.js +8 -2
- package/lib/esm/CheckpointManager.js.map +1 -1
- package/lib/esm/ClassRegistry.js +6 -6
- package/lib/esm/ClassRegistry.js.map +1 -1
- package/lib/esm/CloudSqlite.d.ts.map +1 -1
- package/lib/esm/CloudSqlite.js +29 -11
- package/lib/esm/CloudSqlite.js.map +1 -1
- package/lib/esm/CodeService.js.map +1 -1
- package/lib/esm/CodeSpecs.d.ts +3 -3
- 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 +2 -2
- package/lib/esm/DisplayStyle.js.map +1 -1
- package/lib/esm/ECDb.d.ts.map +1 -1
- package/lib/esm/ECDb.js +1 -0
- 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.map +1 -1
- package/lib/esm/EditTxn.js +1 -0
- package/lib/esm/EditTxn.js.map +1 -1
- package/lib/esm/Element.d.ts +48 -12
- package/lib/esm/Element.d.ts.map +1 -1
- package/lib/esm/Element.js +121 -25
- package/lib/esm/Element.js.map +1 -1
- package/lib/esm/ElementAspect.js.map +1 -1
- package/lib/esm/ElementGraphics.js.map +1 -1
- package/lib/esm/ElementTreeWalker.js.map +1 -1
- package/lib/esm/Entity.js.map +1 -1
- package/lib/esm/EntityReferences.js +1 -1
- package/lib/esm/EntityReferences.js.map +1 -1
- package/lib/esm/ExportGraphics.js.map +1 -1
- 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 +118 -30
- package/lib/esm/IModelDb.d.ts.map +1 -1
- package/lib/esm/IModelDb.js +327 -117
- 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.map +1 -1
- package/lib/esm/IModelHost.js +3 -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.map +1 -1
- 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.js.map +1 -1
- package/lib/esm/Model.d.ts +5 -5
- package/lib/esm/Model.d.ts.map +1 -1
- 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/PartialChangeUnifier.js +7 -7
- package/lib/esm/PartialChangeUnifier.js.map +1 -1
- package/lib/esm/PromiseMemoizer.js.map +1 -1
- package/lib/esm/PropertyStore.js +1 -1
- package/lib/esm/PropertyStore.js.map +1 -1
- 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.d.ts +158 -22
- package/lib/esm/SchemaSync.d.ts.map +1 -1
- package/lib/esm/SchemaSync.js +419 -78
- package/lib/esm/SchemaSync.js.map +1 -1
- package/lib/esm/SchemaUtils.js.map +1 -1
- 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.map +1 -1
- package/lib/esm/SynchronousChannel.d.ts +62 -0
- package/lib/esm/SynchronousChannel.d.ts.map +1 -0
- package/lib/esm/SynchronousChannel.js +9 -0
- package/lib/esm/SynchronousChannel.js.map +1 -0
- package/lib/esm/Texture.d.ts +1 -1
- package/lib/esm/Texture.js.map +1 -1
- package/lib/esm/TileStorage.js.map +1 -1
- package/lib/esm/TxnManager.d.ts +44 -4
- package/lib/esm/TxnManager.d.ts.map +1 -1
- package/lib/esm/TxnManager.js +74 -19
- package/lib/esm/TxnManager.js.map +1 -1
- package/lib/esm/ViewDefinition.d.ts +6 -6
- package/lib/esm/ViewDefinition.d.ts.map +1 -1
- 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.js.map +1 -1
- package/lib/esm/annotations/FrameGeometry.js.map +1 -1
- package/lib/esm/annotations/LeaderGeometry.d.ts +22 -7
- package/lib/esm/annotations/LeaderGeometry.d.ts.map +1 -1
- package/lib/esm/annotations/LeaderGeometry.js +104 -36
- package/lib/esm/annotations/LeaderGeometry.js.map +1 -1
- package/lib/esm/annotations/TextAnnotationElement.d.ts +1 -1
- package/lib/esm/annotations/TextAnnotationElement.d.ts.map +1 -1
- package/lib/esm/annotations/TextAnnotationElement.js +25 -10
- 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.js.map +1 -1
- package/lib/esm/domains/FunctionalSchema.js.map +1 -1
- 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.js.map +1 -1
- package/lib/esm/internal/ECSqlInstanceReshaper.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.d.ts +22 -0
- package/lib/esm/internal/IntegrityCheck.d.ts.map +1 -1
- package/lib/esm/internal/IntegrityCheck.js +13 -0
- 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/NoReservations.d.ts +6 -0
- package/lib/esm/internal/NoReservations.d.ts.map +1 -0
- package/lib/esm/internal/NoReservations.js +18 -0
- package/lib/esm/internal/NoReservations.js.map +1 -0
- package/lib/esm/internal/OnlineStatus.js.map +1 -1
- package/lib/esm/internal/SchemaSyncReservations.d.ts +4 -0
- package/lib/esm/internal/SchemaSyncReservations.d.ts.map +1 -0
- package/lib/esm/internal/SchemaSyncReservations.js +125 -0
- package/lib/esm/internal/SchemaSyncReservations.js.map +1 -0
- package/lib/esm/internal/ServerBasedLocks.js +33 -33
- package/lib/esm/internal/ServerBasedLocks.js.map +1 -1
- package/lib/esm/internal/Symbols.d.ts +1 -0
- package/lib/esm/internal/Symbols.d.ts.map +1 -1
- package/lib/esm/internal/Symbols.js +1 -0
- package/lib/esm/internal/Symbols.js.map +1 -1
- 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.d.ts.map +1 -1
- package/lib/esm/internal/workspace/WorkspaceImpl.js +7 -2
- 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.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.js +23 -23
- 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.map +1 -1
- package/lib/esm/test/IModelTestUtils.d.ts +1 -1
- package/lib/esm/test/IModelTestUtils.d.ts.map +1 -1
- package/lib/esm/test/IModelTestUtils.js +8 -3
- 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.map +1 -1
- package/lib/esm/test/SchemaChangesetCanBeReversed.test.js +51 -51
- package/lib/esm/test/SchemaChangesetCanBeReversed.test.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 +129 -129
- package/lib/esm/test/SquashSchemaAndDataChanges.test.js.map +1 -1
- package/lib/esm/test/TestChangeSetUtility.js.map +1 -1
- package/lib/esm/test/TestEditTxn.js.map +1 -1
- package/lib/esm/test/TestUtils.js.map +1 -1
- package/lib/esm/test/annotations/Fields.test.js +53 -53
- 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 +178 -2
- package/lib/esm/test/annotations/LeaderGeometry.test.js.map +1 -1
- package/lib/esm/test/annotations/TextAnnotation.test.js +48 -18
- package/lib/esm/test/annotations/TextAnnotation.test.js.map +1 -1
- 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.map +1 -1
- 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 +65 -65
- package/lib/esm/test/ecdb/ECSqlAst.test.js.map +1 -1
- package/lib/esm/test/ecdb/ECSqlQuery.test.js +4 -4
- package/lib/esm/test/ecdb/ECSqlQuery.test.js.map +1 -1
- package/lib/esm/test/ecdb/ECSqlStatement.test.js +509 -332
- package/lib/esm/test/ecdb/ECSqlStatement.test.js.map +1 -1
- package/lib/esm/test/ecdb/ECSqlSyncReader.test.js +4 -4
- package/lib/esm/test/ecdb/ECSqlSyncReader.test.js.map +1 -1
- package/lib/esm/test/ecdb/QueryReaders.test.js +33 -47
- package/lib/esm/test/ecdb/QueryReaders.test.js.map +1 -1
- package/lib/esm/test/ecdb/SqliteStatement.test.js.map +1 -1
- 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 +2 -2
- package/lib/esm/test/ecsql/src/ECSqlTestRunner.test.js.map +1 -1
- package/lib/esm/test/element/DeleteDefinitionElements.test.js.map +1 -1
- package/lib/esm/test/element/ElementAspect.test.js +176 -24
- package/lib/esm/test/element/ElementAspect.test.js.map +1 -1
- package/lib/esm/test/element/ElementDependencyGraph.test.js.map +1 -1
- package/lib/esm/test/element/ElementRoundTrip.test.js +224 -141
- package/lib/esm/test/element/ElementRoundTrip.test.js.map +1 -1
- package/lib/esm/test/element/ExcludedElements.test.js.map +1 -1
- package/lib/esm/test/element/ExternalSource.test.js.map +1 -1
- package/lib/esm/test/element/NullStructArray.test.js +13 -13
- package/lib/esm/test/element/NullStructArray.test.js.map +1 -1
- package/lib/esm/test/element/ProjectInformationRecord.test.js.map +1 -1
- package/lib/esm/test/element/SheetInformationAspect.test.js.map +1 -1
- package/lib/esm/test/element/UrlLink.test.js.map +1 -1
- package/lib/esm/test/example-code/EditTxn.test.d.ts +2 -0
- package/lib/esm/test/example-code/EditTxn.test.d.ts.map +1 -0
- package/lib/esm/test/example-code/EditTxn.test.js +47 -0
- package/lib/esm/test/example-code/EditTxn.test.js.map +1 -0
- package/lib/esm/test/font/FontFile.test.js.map +1 -1
- package/lib/esm/test/font/IModelDbFonts.test.js.map +1 -1
- package/lib/esm/test/hubaccess/ApplyChangeset.test.js +32 -32
- package/lib/esm/test/hubaccess/ApplyChangeset.test.js.map +1 -1
- package/lib/esm/test/hubaccess/BriefcaseManager.test.js.map +1 -1
- package/lib/esm/test/hubaccess/CheckpointManager.test.js +43 -1
- package/lib/esm/test/hubaccess/CheckpointManager.test.js.map +1 -1
- package/lib/esm/test/hubaccess/CodeSwap.test.js.map +1 -1
- package/lib/esm/test/hubaccess/Rebase.test.js +59 -57
- package/lib/esm/test/hubaccess/Rebase.test.js.map +1 -1
- package/lib/esm/test/hubaccess/SemanticRebase.test.js +374 -373
- package/lib/esm/test/hubaccess/SemanticRebase.test.js.map +1 -1
- package/lib/esm/test/hubaccess/SemanticRebaseTestUtils.d.ts +3 -0
- package/lib/esm/test/hubaccess/SemanticRebaseTestUtils.d.ts.map +1 -0
- package/lib/esm/test/hubaccess/SemanticRebaseTestUtils.js +15 -0
- package/lib/esm/test/hubaccess/SemanticRebaseTestUtils.js.map +1 -0
- package/lib/esm/test/imageData.js.map +1 -1
- package/lib/esm/test/imodel/Code.test.js.map +1 -1
- 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/IModelECSql.test.d.ts +2 -0
- package/lib/esm/test/imodel/IModelECSql.test.d.ts.map +1 -0
- package/lib/esm/test/imodel/IModelECSql.test.js +367 -0
- package/lib/esm/test/imodel/IModelECSql.test.js.map +1 -0
- package/lib/esm/test/imodel/IModelElements.test.d.ts +2 -0
- package/lib/esm/test/imodel/IModelElements.test.d.ts.map +1 -0
- package/lib/esm/test/imodel/IModelElements.test.js +969 -0
- package/lib/esm/test/imodel/IModelElements.test.js.map +1 -0
- package/lib/esm/test/imodel/IModelGeolocation.test.d.ts +2 -0
- package/lib/esm/test/imodel/IModelGeolocation.test.d.ts.map +1 -0
- package/lib/esm/test/imodel/IModelGeolocation.test.js +539 -0
- package/lib/esm/test/imodel/IModelGeolocation.test.js.map +1 -0
- package/lib/esm/test/imodel/IModelLifecycle.test.d.ts +2 -0
- package/lib/esm/test/imodel/IModelLifecycle.test.d.ts.map +1 -0
- package/lib/esm/test/imodel/IModelLifecycle.test.js +499 -0
- package/lib/esm/test/imodel/IModelLifecycle.test.js.map +1 -0
- package/lib/esm/test/imodel/IModelMetadata.test.d.ts +2 -0
- package/lib/esm/test/imodel/IModelMetadata.test.d.ts.map +1 -0
- package/lib/esm/test/imodel/IModelMetadata.test.js +274 -0
- package/lib/esm/test/imodel/IModelMetadata.test.js.map +1 -0
- package/lib/esm/test/imodel/IModelModels.test.d.ts +2 -0
- package/lib/esm/test/imodel/IModelModels.test.d.ts.map +1 -0
- package/lib/esm/test/imodel/IModelModels.test.js +357 -0
- package/lib/esm/test/imodel/IModelModels.test.js.map +1 -0
- package/lib/esm/test/imodel/IModelRelationships.test.d.ts +2 -0
- package/lib/esm/test/imodel/IModelRelationships.test.d.ts.map +1 -0
- package/lib/esm/test/imodel/IModelRelationships.test.js +407 -0
- package/lib/esm/test/imodel/IModelRelationships.test.js.map +1 -0
- package/lib/esm/test/imodel/IModelTestFixtures.d.ts +53 -0
- package/lib/esm/test/imodel/IModelTestFixtures.d.ts.map +1 -0
- package/lib/esm/test/imodel/IModelTestFixtures.js +107 -0
- package/lib/esm/test/imodel/IModelTestFixtures.js.map +1 -0
- package/lib/esm/test/imodel/IModelViews.test.d.ts +2 -0
- package/lib/esm/test/imodel/IModelViews.test.d.ts.map +1 -0
- package/lib/esm/test/imodel/IModelViews.test.js +199 -0
- package/lib/esm/test/imodel/IModelViews.test.js.map +1 -0
- package/lib/esm/test/imodel/ProjectExtents.test.js.map +1 -1
- package/lib/esm/test/imodel/SchemaXmlImport.test.js +21 -21
- 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.js.map +1 -1
- package/lib/esm/test/index.d.ts +0 -1
- package/lib/esm/test/index.d.ts.map +1 -1
- package/lib/esm/test/index.js +0 -1
- package/lib/esm/test/index.js.map +1 -1
- package/lib/esm/test/internal/ECSqlInstanceReshaper.test.js +32 -32
- package/lib/esm/test/internal/ECSqlInstanceReshaper.test.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/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 +99 -99
- package/lib/esm/test/schema/ClassRegistry.test.js.map +1 -1
- package/lib/esm/test/schema/FunctionalDomain.test.js.map +1 -1
- package/lib/esm/test/schema/GenericDomain.test.js.map +1 -1
- package/lib/esm/test/schema/IModelSchemaContext.test.js +9 -9
- package/lib/esm/test/schema/IModelSchemaContext.test.js.map +1 -1
- package/lib/esm/test/schema/SchemaImportCallbacks.test.js +19 -19
- package/lib/esm/test/schema/SchemaImportCallbacks.test.js.map +1 -1
- package/lib/esm/test/schema/SchemaViewFragmentLoading.test.js +21 -21
- package/lib/esm/test/schema/SchemaViewFragmentLoading.test.js.map +1 -1
- package/lib/esm/test/schema/SchemaViewHidden.test.js +109 -109
- package/lib/esm/test/schema/SchemaViewHidden.test.js.map +1 -1
- package/lib/esm/test/schema/SchemaViewKoQ.test.js +13 -13
- package/lib/esm/test/schema/SchemaViewKoQ.test.js.map +1 -1
- package/lib/esm/test/schema/SchemaViewLifecycle.test.js +15 -15
- package/lib/esm/test/schema/SchemaViewLifecycle.test.js.map +1 -1
- package/lib/esm/test/schema/SchemaViewValidation.test.js +8 -8
- package/lib/esm/test/schema/SchemaViewValidation.test.js.map +1 -1
- package/lib/esm/test/sheetindex/SheetIndex.test.js.map +1 -1
- package/lib/esm/test/standalone/ChangeElementParentModel.test.js.map +1 -1
- package/lib/esm/test/standalone/ChangeMerge.test.js.map +1 -1
- package/lib/esm/test/standalone/ChangesetReader.test.js +321 -339
- package/lib/esm/test/standalone/ChangesetReader.test.js.map +1 -1
- package/lib/esm/test/standalone/CloudSqlite.test.js +73 -0
- package/lib/esm/test/standalone/CloudSqlite.test.js.map +1 -1
- package/lib/esm/test/standalone/CustomViewState3dCreator.test.js.map +1 -1
- package/lib/esm/test/standalone/DeleteElements.test.js.map +1 -1
- package/lib/esm/test/standalone/DgnDomainMergeConflict.test.d.ts +2 -0
- package/lib/esm/test/standalone/DgnDomainMergeConflict.test.d.ts.map +1 -0
- package/lib/esm/test/standalone/DgnDomainMergeConflict.test.js +263 -0
- package/lib/esm/test/standalone/DgnDomainMergeConflict.test.js.map +1 -0
- package/lib/esm/test/standalone/DisplayStyle.test.js.map +1 -1
- package/lib/esm/test/standalone/Drawing.test.js.map +1 -1
- package/lib/esm/test/standalone/EditTxn.test.js.map +1 -1
- package/lib/esm/test/standalone/ElementGraphics.test.js.map +1 -1
- package/lib/esm/test/standalone/ElementMesh.test.js.map +1 -1
- package/lib/esm/test/standalone/ExportGraphics.test.js +14 -14
- package/lib/esm/test/standalone/ExportGraphics.test.js.map +1 -1
- package/lib/esm/test/standalone/GeometryChangeEvents.test.js.map +1 -1
- package/lib/esm/test/standalone/GeometryStream.test.js +1 -3
- package/lib/esm/test/standalone/GeometryStream.test.js.map +1 -1
- package/lib/esm/test/standalone/HubMock.test.js.map +1 -1
- package/lib/esm/test/standalone/IModelLimits.test.js.map +1 -1
- package/lib/esm/test/standalone/IModelWrite.test.d.ts.map +1 -1
- package/lib/esm/test/standalone/IModelWrite.test.js +105 -28
- 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.map +1 -1
- package/lib/esm/test/standalone/IntegrityCheck.test.js +29 -10
- package/lib/esm/test/standalone/IntegrityCheck.test.js.map +1 -1
- 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.map +1 -1
- 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/SQliteChangesetReaderAndChangesetECAdaptor.test.js +158 -135
- package/lib/esm/test/standalone/SQliteChangesetReaderAndChangesetECAdaptor.test.js.map +1 -1
- package/lib/esm/test/standalone/SchemaSyncDb.test.d.ts +2 -0
- package/lib/esm/test/standalone/SchemaSyncDb.test.d.ts.map +1 -0
- package/lib/esm/test/standalone/SchemaSyncDb.test.js +201 -0
- package/lib/esm/test/standalone/SchemaSyncDb.test.js.map +1 -0
- package/lib/esm/test/standalone/SchemaSyncElementReservation.test.d.ts +2 -0
- package/lib/esm/test/standalone/SchemaSyncElementReservation.test.d.ts.map +1 -0
- package/lib/esm/test/standalone/SchemaSyncElementReservation.test.js +460 -0
- package/lib/esm/test/standalone/SchemaSyncElementReservation.test.js.map +1 -0
- package/lib/esm/test/standalone/SchemaUtils.test.js.map +1 -1
- package/lib/esm/test/standalone/SectionDrawing.test.js.map +1 -1
- 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.map +1 -1
- package/lib/esm/test/standalone/SettingsSchemas.test.js.map +1 -1
- package/lib/esm/test/standalone/SnapshotDb.test.js +1 -0
- package/lib/esm/test/standalone/SnapshotDb.test.js.map +1 -1
- package/lib/esm/test/standalone/StandaloneDb.test.js +20 -20
- package/lib/esm/test/standalone/StandaloneDb.test.js.map +1 -1
- package/lib/esm/test/standalone/Texture.test.js.map +1 -1
- package/lib/esm/test/standalone/TileCache.test.js.map +1 -1
- package/lib/esm/test/standalone/TileTree.test.js.map +1 -1
- package/lib/esm/test/standalone/TxnManager.test.js +108 -8
- package/lib/esm/test/standalone/TxnManager.test.js.map +1 -1
- 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 +52 -0
- 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 +19 -23
- package/lib/esm/test/RevisionUtility.d.ts +0 -33
- package/lib/esm/test/RevisionUtility.d.ts.map +0 -1
- package/lib/esm/test/RevisionUtility.js +0 -52
- package/lib/esm/test/RevisionUtility.js.map +0 -1
- package/lib/esm/test/imodel/IModel.test.d.ts +0 -2
- package/lib/esm/test/imodel/IModel.test.d.ts.map +0 -1
- package/lib/esm/test/imodel/IModel.test.js +0 -3279
- package/lib/esm/test/imodel/IModel.test.js.map +0 -1
package/lib/esm/IModelDb.js
CHANGED
|
@@ -8,8 +8,8 @@
|
|
|
8
8
|
import * as fs from "fs";
|
|
9
9
|
import { join } from "path";
|
|
10
10
|
import * as touch from "touch";
|
|
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, EditTxnError, EntityMetaData, FontMap, IModel, IModelError, IModelNotFoundResponse, ProfileOptions, QueryBinder, QueryRowFormat, resolveNavPropId, SchemaState, ViewStoreError, ViewStoreRpc } from "@itwin/core-common";
|
|
11
|
+
import { assert, BeEvent, BentleyStatus, ChangeSetStatus, DbChangeStage, DbConflictCause, DbConflictResolution, DbOpcode, DbResult, Guid, Id64, IModelStatus, JsonUtils, Logger, LogLevel, LRUMap, OpenMode } from "@itwin/core-bentley";
|
|
12
|
+
import { Base64EncodedString, BriefcaseIdValue, Code, DomainOptions, ECJsNames, ECSqlReader, EditTxnError, EntityMetaData, FontMap, IModel, IModelError, IModelNotFoundResponse, ProfileOptions, QueryBinder, QueryRowFormat, resolveNavPropId, 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";
|
|
@@ -45,7 +45,9 @@ import { constructWorkspace, throwWorkspaceDbLoadErrors } from "./internal/works
|
|
|
45
45
|
import { SettingsImpl } from "./internal/workspace/SettingsImpl";
|
|
46
46
|
import { IModelNative } from "./internal/NativePlatform";
|
|
47
47
|
import { createNoOpLockControl } from "./internal/NoLocks";
|
|
48
|
+
import { createNoOpReservations } from "./internal/NoReservations";
|
|
48
49
|
import { createIModelDbFonts } from "./internal/IModelDbFontsImpl";
|
|
50
|
+
import { createSchemaSyncReservations } from "./internal/SchemaSyncReservations";
|
|
49
51
|
import { _activeTxn, _cache, _close, _hubAccess, _implicitTxn, _instanceKeyCache, _nativeDb, _releaseAllLocks, _resetIModelDb } from "./internal/Symbols";
|
|
50
52
|
import { ECVersion, SchemaContext, SchemaJsonLocater, SchemaManifest, SchemaViewManager } from "@itwin/ecschema-metadata";
|
|
51
53
|
import { SchemaMap } from "./Schema";
|
|
@@ -175,6 +177,8 @@ export class IModelDb extends IModel {
|
|
|
175
177
|
/** @internal */
|
|
176
178
|
_locks = createNoOpLockControl();
|
|
177
179
|
/** @internal */
|
|
180
|
+
_reservations = createNoOpReservations();
|
|
181
|
+
/** @internal */
|
|
178
182
|
_codeService;
|
|
179
183
|
/**
|
|
180
184
|
* The always-available implicit transaction for this iModel.
|
|
@@ -185,12 +189,16 @@ export class IModelDb extends IModel {
|
|
|
185
189
|
[_implicitTxn];
|
|
186
190
|
/** @internal */
|
|
187
191
|
[_activeTxn];
|
|
188
|
-
/** Returns the
|
|
189
|
-
*
|
|
190
|
-
*
|
|
191
|
-
*
|
|
192
|
-
*
|
|
193
|
-
*
|
|
192
|
+
/** Returns the transaction to use for additional edits from an element, model, or aspect callback.
|
|
193
|
+
* In callbacks whose arguments provide an [[IModelDb]] but no transaction, obtain this transaction through
|
|
194
|
+
* `arg.iModel.getIndirectTxn()` and pass it to APIs that accept an [[EditTxn]].
|
|
195
|
+
*
|
|
196
|
+
* If an explicit transaction is active, this returns that transaction. Otherwise, it returns the implicit transaction
|
|
197
|
+
* used by legacy write paths. Callbacks that receive an `indirectEditTxn` argument should use that transaction directly.
|
|
198
|
+
*
|
|
199
|
+
* @note The operation that invoked the callback owns the transaction. Callback implementations must not invoke transaction
|
|
200
|
+
* lifecycle methods such as [[EditTxn.start]], [[EditTxn.end]], [[EditTxn.saveChanges]], [[EditTxn.abandonChanges]], or [[EditTxn.onClose]].
|
|
201
|
+
* @beta
|
|
194
202
|
*/
|
|
195
203
|
getIndirectTxn() {
|
|
196
204
|
return this[_activeTxn] ?? this[_implicitTxn];
|
|
@@ -199,6 +207,16 @@ export class IModelDb extends IModel {
|
|
|
199
207
|
get codeService() { return this._codeService; }
|
|
200
208
|
/** The [[LockControl]] that orchestrates [concurrent editing]($docs/learning/backend/ConcurrencyControl.md) of this iModel. */
|
|
201
209
|
get locks() { return this._locks; } // eslint-disable-line @typescript-eslint/no-non-null-assertion
|
|
210
|
+
/** @beta The [[SynchronousChannel.Reservations]] that orchestrates [concurrent editing]($docs/learning/backend/ConcurrencyControl.md) of this iModel. */
|
|
211
|
+
get reservations() { return this._reservations; } // eslint-disable-line @typescript-eslint/no-non-null-assertion
|
|
212
|
+
/** @internal */
|
|
213
|
+
async initializeSharedElementReservations() {
|
|
214
|
+
this._reservations?.[_close]();
|
|
215
|
+
if (SchemaSync.isEnabled(this))
|
|
216
|
+
this._reservations = await createSchemaSyncReservations(this);
|
|
217
|
+
else
|
|
218
|
+
this._reservations = createNoOpReservations();
|
|
219
|
+
}
|
|
202
220
|
/** Provides methods for interacting with [font-related information]($docs/learning/backend/Fonts.md) stored in this iModel.
|
|
203
221
|
* @beta
|
|
204
222
|
*/
|
|
@@ -299,7 +317,9 @@ export class IModelDb extends IModel {
|
|
|
299
317
|
db[_nativeDb].abandonChanges();
|
|
300
318
|
db.close();
|
|
301
319
|
}
|
|
302
|
-
catch {
|
|
320
|
+
catch {
|
|
321
|
+
return;
|
|
322
|
+
}
|
|
303
323
|
});
|
|
304
324
|
});
|
|
305
325
|
}
|
|
@@ -356,18 +376,29 @@ export class IModelDb extends IModel {
|
|
|
356
376
|
this.optimize();
|
|
357
377
|
IModelDb._openDbs.delete(this._fileKey);
|
|
358
378
|
this._workspace?.close();
|
|
379
|
+
this.views[_close]();
|
|
359
380
|
this.locks[_close]();
|
|
360
381
|
this._locks = undefined;
|
|
382
|
+
this.reservations[_close]();
|
|
383
|
+
this._reservations = undefined;
|
|
361
384
|
this._codeService?.close();
|
|
362
385
|
this._codeService = undefined;
|
|
363
386
|
this[_nativeDb].closeFile();
|
|
364
387
|
}
|
|
388
|
+
/**
|
|
389
|
+
* Save any unsaved schema changes in this iModel.
|
|
390
|
+
* @internal
|
|
391
|
+
*/
|
|
365
392
|
saveSchemaChanges(args) {
|
|
366
393
|
if (!this[_nativeDb].hasUnsavedChanges())
|
|
367
394
|
return;
|
|
368
395
|
const saveArgs = typeof args === "string" ? { description: args } : args;
|
|
369
396
|
saveArgs === undefined ? this[_nativeDb].saveChanges() : this[_nativeDb].saveChanges(JSON.stringify(saveArgs));
|
|
370
397
|
}
|
|
398
|
+
/**
|
|
399
|
+
* Abandon any unsaved schema changes in this iModel.
|
|
400
|
+
* @internal
|
|
401
|
+
*/
|
|
371
402
|
abandonSchemaChanges() {
|
|
372
403
|
if (!this[_nativeDb].hasUnsavedChanges())
|
|
373
404
|
return;
|
|
@@ -914,7 +945,7 @@ export class IModelDb extends IModel {
|
|
|
914
945
|
async dropSchemas(schemaNames) {
|
|
915
946
|
if (schemaNames.length === 0)
|
|
916
947
|
return;
|
|
917
|
-
if (
|
|
948
|
+
if (SchemaSync.isEnabled(this))
|
|
918
949
|
throw new IModelError(DbResult.BE_SQLITE_ERROR, "Cannot drop schemas when schema sync is enabled");
|
|
919
950
|
if (this[_nativeDb].hasUnsavedChanges())
|
|
920
951
|
throw new IModelError(ChangeSetStatus.HasUncommittedChanges, "Cannot drop schemas with unsaved changes");
|
|
@@ -1000,26 +1031,34 @@ export class IModelDb extends IModel {
|
|
|
1000
1031
|
this.cleanupSnapshot(context.resources);
|
|
1001
1032
|
}
|
|
1002
1033
|
}
|
|
1003
|
-
/**
|
|
1004
|
-
|
|
1005
|
-
|
|
1006
|
-
|
|
1007
|
-
|
|
1008
|
-
|
|
1009
|
-
|
|
1010
|
-
|
|
1011
|
-
|
|
1012
|
-
|
|
1013
|
-
|
|
1014
|
-
|
|
1015
|
-
|
|
1016
|
-
|
|
1017
|
-
|
|
1018
|
-
|
|
1019
|
-
|
|
1020
|
-
|
|
1034
|
+
/** Refuse a schema import this briefcase is in no state to run. Shared by [[importSchemas]] and
|
|
1035
|
+
* [[BriefcaseDb.upgradeSchemas]], which reach the native importer by different routes.
|
|
1036
|
+
* @internal
|
|
1037
|
+
*/
|
|
1038
|
+
assertCanImportSchemas() {
|
|
1039
|
+
if (!this.isBriefcaseDb())
|
|
1040
|
+
return;
|
|
1041
|
+
if (this.txns.rebaser.isRebasing) {
|
|
1042
|
+
throw new IModelError(IModelStatus.BadRequest, "Cannot import schemas while rebasing");
|
|
1043
|
+
}
|
|
1044
|
+
if (this.txns.isIndirectChanges) {
|
|
1045
|
+
throw new IModelError(IModelStatus.BadRequest, "Cannot import schemas while in an indirect change scope");
|
|
1046
|
+
}
|
|
1047
|
+
// Additional checks when semantic rebase is enabled
|
|
1048
|
+
if (IModelHost.useSemanticRebase) {
|
|
1049
|
+
if (this[_nativeDb].hasUnsavedChanges()) {
|
|
1050
|
+
throw new IModelError(IModelStatus.BadRequest, "Cannot import schemas with unsaved changes when useSemanticRebase flag is on");
|
|
1051
|
+
}
|
|
1052
|
+
if (SchemaSync.isEnabled(this)) {
|
|
1053
|
+
throw new IModelError(IModelStatus.BadRequest, "Cannot import schemas when schema sync is enabled and also useSemanticRebase flag is on");
|
|
1021
1054
|
}
|
|
1022
1055
|
}
|
|
1056
|
+
}
|
|
1057
|
+
/** Shared implementation for importing schemas from file or string.
|
|
1058
|
+
* @internal
|
|
1059
|
+
*/
|
|
1060
|
+
async importSchemasInternal(schemas, options, nativeImportOp) {
|
|
1061
|
+
this.assertCanImportSchemas();
|
|
1023
1062
|
if (options?.channelUpgrade) {
|
|
1024
1063
|
const channelUpgrade = options.channelUpgrade;
|
|
1025
1064
|
try {
|
|
@@ -1037,30 +1076,52 @@ export class IModelDb extends IModel {
|
|
|
1037
1076
|
if (options?.schemaImportCallbacks?.preSchemaImportCallback)
|
|
1038
1077
|
preSchemaImportCallbackResult = await this.preSchemaImportCallback(options.schemaImportCallbacks, { iModel: this, data: options.data, schemaData: schemas });
|
|
1039
1078
|
const maybeCustomNativeContext = options?.ecSchemaXmlContext?.nativeContext;
|
|
1040
|
-
if (
|
|
1041
|
-
|
|
1042
|
-
|
|
1043
|
-
this.
|
|
1044
|
-
|
|
1045
|
-
|
|
1046
|
-
|
|
1047
|
-
|
|
1048
|
-
|
|
1049
|
-
|
|
1050
|
-
|
|
1051
|
-
|
|
1052
|
-
|
|
1053
|
-
|
|
1054
|
-
|
|
1055
|
-
|
|
1056
|
-
|
|
1057
|
-
|
|
1079
|
+
if (SchemaSync.isEnabled(this)) {
|
|
1080
|
+
// The shared lock lets concurrent updates through while blocking anyone taking the exclusive lock for an upgrade.
|
|
1081
|
+
if (this[_nativeDb].getITwinId() !== Guid.empty)
|
|
1082
|
+
await this.locks.acquireLocks({ shared: IModel.repositoryModelId });
|
|
1083
|
+
// The native import adopts rows from the attached SchemaSyncDb. Attach and detach commit
|
|
1084
|
+
// implicitly, so abandoning changes cannot undo the adoption. A later failure must roll the
|
|
1085
|
+
// briefcase back before those ec_ rows can be pushed.
|
|
1086
|
+
let txnBeforeAdopt;
|
|
1087
|
+
// Set once the caller's own work is committed. Getting a token or the container write lock happens
|
|
1088
|
+
// before that, and abandonSchemaChanges discards every unsaved change rather than only this import's,
|
|
1089
|
+
// so abandoning on a failure from that window would throw away work the import never touched.
|
|
1090
|
+
let callerChangesSaved = false;
|
|
1091
|
+
try {
|
|
1092
|
+
await SchemaSync.withLockedAccess(this, { openMode: OpenMode.Readonly, operationName: "schema sync" }, async (syncAccess) => {
|
|
1093
|
+
const schemaSyncDbUri = syncAccess.getUri();
|
|
1094
|
+
this.saveSchemaChanges();
|
|
1095
|
+
callerChangesSaved = true;
|
|
1096
|
+
// After saveSchemaChanges, so rolling back cannot reach the caller's own work.
|
|
1097
|
+
if (this.isBriefcaseDb())
|
|
1098
|
+
txnBeforeAdopt = this.txns.getCurrentTxnId();
|
|
1099
|
+
try {
|
|
1100
|
+
nativeImportOp(schemas, { schemaLockHeld: false, ecSchemaXmlContext: maybeCustomNativeContext, schemaSyncDbUri });
|
|
1058
1101
|
}
|
|
1059
|
-
|
|
1060
|
-
|
|
1102
|
+
catch (err) {
|
|
1103
|
+
if (SchemaSync.requiresUpgrade(err))
|
|
1104
|
+
throw new IModelError(err.errorNumber, `${err.message} - this schema change needs the upgrade path. Use BriefcaseDb.upgradeSchemas, which takes the exclusive schema lock and pushes the result.`);
|
|
1105
|
+
throw new IModelError(err.errorNumber, err.message);
|
|
1061
1106
|
}
|
|
1107
|
+
});
|
|
1108
|
+
}
|
|
1109
|
+
catch (err) {
|
|
1110
|
+
if (callerChangesSaved)
|
|
1111
|
+
this.abandonSchemaChanges();
|
|
1112
|
+
if (this.isBriefcaseDb() && undefined !== txnBeforeAdopt && this.txns.getCurrentTxnId() !== txnBeforeAdopt) {
|
|
1113
|
+
// Saving the adopt's txn started a new undo session, because schema changes are kept out of the
|
|
1114
|
+
// user's undo stack, so this reverses across that boundary. The changes themselves reverse like
|
|
1115
|
+
// any other - a rebase does it to every local txn on every pull. It does not reverse DDL: a table
|
|
1116
|
+
// or column the adopt created stays behind with no ec_ row describing it, which is the state a
|
|
1117
|
+
// briefcase already tolerates, and the next successful import finds the table up to date and
|
|
1118
|
+
// carries on. Cancel rather than reverse, so the rows cannot come back through undo either.
|
|
1119
|
+
const status = this[_nativeDb].cancelTo(txnBeforeAdopt, true);
|
|
1120
|
+
if (IModelStatus.Success !== status)
|
|
1121
|
+
Logger.logError(loggerCategory, `Failed to roll back the adopted schema rows after a failed import: ${IModelStatus[status] ?? status}`);
|
|
1062
1122
|
}
|
|
1063
|
-
|
|
1123
|
+
throw err;
|
|
1124
|
+
}
|
|
1064
1125
|
}
|
|
1065
1126
|
else {
|
|
1066
1127
|
const nativeImportOptions = {
|
|
@@ -2169,7 +2230,7 @@ function processSchemaWriteStatus(status) {
|
|
|
2169
2230
|
* @param props The data for the new model.
|
|
2170
2231
|
* @returns The newly inserted model's Id.
|
|
2171
2232
|
* @throws [[IModelError]] if insertion fails.
|
|
2172
|
-
* @deprecated in 5.9.0 -
|
|
2233
|
+
* @deprecated in 5.9.0 - might be removed in next major version. Use EditTxn.insertModel instead, within an explicit EditTxn scope (or via withEditTxn). See EditTxn documentation for migration help.
|
|
2173
2234
|
*/
|
|
2174
2235
|
insertModel(props) {
|
|
2175
2236
|
return this._iModel[_implicitTxn].insertModel(props);
|
|
@@ -2177,7 +2238,7 @@ function processSchemaWriteStatus(status) {
|
|
|
2177
2238
|
/** Update an existing model.
|
|
2178
2239
|
* @param props the properties of the model to change
|
|
2179
2240
|
* @throws [[IModelError]] if update fails.
|
|
2180
|
-
* @deprecated in 5.9.0 -
|
|
2241
|
+
* @deprecated in 5.9.0 - might be removed in next major version. Use EditTxn.updateModel instead, within an explicit EditTxn scope (or via withEditTxn). See EditTxn documentation for migration help.
|
|
2181
2242
|
*/
|
|
2182
2243
|
updateModel(props) {
|
|
2183
2244
|
this._iModel[_implicitTxn].updateModel(props);
|
|
@@ -2189,7 +2250,7 @@ function processSchemaWriteStatus(status) {
|
|
|
2189
2250
|
* Cached [Tile]($frontend)s are only invalidated after the geometry guid of the model changes.
|
|
2190
2251
|
* @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.
|
|
2191
2252
|
* @throws [[IModelError]] if the update fails.
|
|
2192
|
-
* @deprecated in 5.9.0 -
|
|
2253
|
+
* @deprecated in 5.9.0 - might be removed in next major version. Use EditTxn.updateGeometryGuid instead, within an explicit EditTxn scope (or via withEditTxn). See EditTxn documentation for migration help.
|
|
2193
2254
|
* @see [[TxnManager.onModelGeometryChanged]] for the event emitted in response to such a change.
|
|
2194
2255
|
*/
|
|
2195
2256
|
updateGeometryGuid(modelId) {
|
|
@@ -2198,7 +2259,7 @@ function processSchemaWriteStatus(status) {
|
|
|
2198
2259
|
/** Delete one or more existing models.
|
|
2199
2260
|
* @param ids The Ids of the models to be deleted
|
|
2200
2261
|
* @throws [[IModelError]] if deletion fails.
|
|
2201
|
-
* @deprecated in 5.9.0 -
|
|
2262
|
+
* @deprecated in 5.9.0 - might be removed in next major version. Use EditTxn.deleteModel instead, within an explicit EditTxn scope (or via withEditTxn). See EditTxn documentation for migration help.
|
|
2202
2263
|
*/
|
|
2203
2264
|
deleteModel(ids) {
|
|
2204
2265
|
this._iModel[_implicitTxn].deleteModel(ids);
|
|
@@ -2422,7 +2483,7 @@ function processSchemaWriteStatus(status) {
|
|
|
2422
2483
|
* However when `elProps.federationGuid` is not present or undefined, a new Guid will be generated and stored on the resultant element. But
|
|
2423
2484
|
* the value of `elProps.federationGuid` is *not* updated. Generally, it is best to re-read the element after inserting (e.g. via [[getElementProps]])
|
|
2424
2485
|
* if you intend to continue working with it. That will ensure its values reflect the persistent state.
|
|
2425
|
-
* @deprecated in 5.9.0 -
|
|
2486
|
+
* @deprecated in 5.9.0 - might be removed in next major version. Use EditTxn.insertElement instead, within an explicit EditTxn scope (or via withEditTxn). See EditTxn documentation for migration help.
|
|
2426
2487
|
*/
|
|
2427
2488
|
insertElement(elProps, options) {
|
|
2428
2489
|
return this._iModel[_implicitTxn].insertElement(elProps, options);
|
|
@@ -2437,7 +2498,7 @@ function processSchemaWriteStatus(status) {
|
|
|
2437
2498
|
* @note The values of `classFullName` and `model` *may not be changed* by this method. Further, it will permute the `elProps` object by adding or
|
|
2438
2499
|
* overwriting their values to the correct values.
|
|
2439
2500
|
* @throws [[ITwinError]] if update fails.
|
|
2440
|
-
* @deprecated in 5.9.0 -
|
|
2501
|
+
* @deprecated in 5.9.0 - might be removed in next major version. Use EditTxn.updateElement instead, within an explicit EditTxn scope (or via withEditTxn). See EditTxn documentation for migration help.
|
|
2441
2502
|
*/
|
|
2442
2503
|
updateElement(elProps) {
|
|
2443
2504
|
this._iModel[_implicitTxn].updateElement(elProps);
|
|
@@ -2446,7 +2507,7 @@ function processSchemaWriteStatus(status) {
|
|
|
2446
2507
|
* @param ids The set of Ids of the element(s) to be deleted
|
|
2447
2508
|
* @throws [[ITwinError]]
|
|
2448
2509
|
* @see deleteDefinitionElements
|
|
2449
|
-
* @deprecated in 5.9.0 -
|
|
2510
|
+
* @deprecated in 5.9.0 - might be removed in next major version. Use EditTxn.deleteElement instead, within an explicit EditTxn scope (or via withEditTxn). See EditTxn documentation for migration help.
|
|
2450
2511
|
*/
|
|
2451
2512
|
deleteElement(ids) {
|
|
2452
2513
|
this._iModel[_implicitTxn].deleteElement(ids);
|
|
@@ -2457,7 +2518,7 @@ function processSchemaWriteStatus(status) {
|
|
|
2457
2518
|
* @param deleteOptions Options for the delete operation.
|
|
2458
2519
|
* @returns A result object containing information about the deletion operation success and the element ids that failed to delete (if any).
|
|
2459
2520
|
* @throws [[ITwinError]] if any of the supplied ids are not well-formed/valid [[Id64String]]s.
|
|
2460
|
-
* @deprecated in 5.1.9 -
|
|
2521
|
+
* @deprecated in 5.1.9 - might be removed in next major version. Use EditTxn.deleteElements instead, within an explicit EditTxn scope (or via withEditTxn). See EditTxn documentation for migration help.
|
|
2461
2522
|
* @beta
|
|
2462
2523
|
*/
|
|
2463
2524
|
deleteElements(ids, deleteOptions) {
|
|
@@ -2471,7 +2532,7 @@ function processSchemaWriteStatus(status) {
|
|
|
2471
2532
|
* DefinitionElements rather than calling this method separately for each one. Ids that are not valid DefinitionElements will be ignored.
|
|
2472
2533
|
* @returns An IdSet of the DefinitionElements that are used and were therefore not deleted.
|
|
2473
2534
|
* @see deleteElement
|
|
2474
|
-
* @deprecated in 5.9.0 -
|
|
2535
|
+
* @deprecated in 5.9.0 - might be removed in next major version. Use EditTxn.deleteDefinitionElements instead, within an explicit EditTxn scope (or via withEditTxn). See EditTxn documentation for migration help.
|
|
2475
2536
|
*/
|
|
2476
2537
|
deleteDefinitionElements(definitionElementIds) {
|
|
2477
2538
|
return this._iModel[_implicitTxn].deleteDefinitionElements(definitionElementIds);
|
|
@@ -2574,21 +2635,27 @@ function processSchemaWriteStatus(status) {
|
|
|
2574
2635
|
return this._queryAspect(aspectInstanceId, aspectClassFullName);
|
|
2575
2636
|
}
|
|
2576
2637
|
static classMap = new Map();
|
|
2638
|
+
getAspectPropsFromInstanceQuery(rawInstance) {
|
|
2639
|
+
const parsedRow = typeof rawInstance === "string" ? JSON.parse(rawInstance, Base64EncodedString.reviver) : rawInstance;
|
|
2640
|
+
if (!JsonUtils.isObject(parsedRow))
|
|
2641
|
+
throw new IModelError(IModelStatus.BadRequest, "Expected an ElementAspect instance query to return an object");
|
|
2642
|
+
const row = {};
|
|
2643
|
+
for (const [key, value] of Object.entries(parsedRow)) {
|
|
2644
|
+
const ecPropertyName = key.length === 0 ? key : key[0].toUpperCase() + key.substring(1);
|
|
2645
|
+
row[ECJsNames.toJsName(ecPropertyName)] = value;
|
|
2646
|
+
}
|
|
2647
|
+
const className = row.className;
|
|
2648
|
+
if (typeof className !== "string")
|
|
2649
|
+
throw new IModelError(IModelStatus.BadRequest, "Expected an ElementAspect instance query to return a className");
|
|
2650
|
+
row.classFullName = className.replace(".", ":"); // add in property required by EntityProps
|
|
2651
|
+
delete row.className; // clear property from SELECT $ that we don't want in the final instance
|
|
2652
|
+
return row;
|
|
2653
|
+
}
|
|
2577
2654
|
runInstanceQuery(sql, elementId, excludedClassFullNames) {
|
|
2578
2655
|
return this._iModel.withQueryReader(sql, (reader) => {
|
|
2579
2656
|
const aspects = [];
|
|
2580
2657
|
for (const queryRow of reader) {
|
|
2581
|
-
const
|
|
2582
|
-
const rawInstance = queryRow[0];
|
|
2583
|
-
const parsedRow = typeof rawInstance === "string" ? JSON.parse(rawInstance) : rawInstance;
|
|
2584
|
-
// eslint-disable-next-line guard-for-in
|
|
2585
|
-
for (const key in parsedRow) {
|
|
2586
|
-
const jsName = ECJsNames.toJsName(key[0].toUpperCase() + key.substring(1));
|
|
2587
|
-
Object.defineProperty(row, jsName, { enumerable: true, configurable: true, writable: true, value: parsedRow[key] });
|
|
2588
|
-
}
|
|
2589
|
-
const aspectProps = row;
|
|
2590
|
-
aspectProps.classFullName = aspectProps.className.replace(".", ":"); // add in property required by EntityProps
|
|
2591
|
-
aspectProps.className = undefined; // clear property from SELECT $ that we don't want in the final instance
|
|
2658
|
+
const aspectProps = this.getAspectPropsFromInstanceQuery(queryRow[0]);
|
|
2592
2659
|
if ((undefined === excludedClassFullNames) || !excludedClassFullNames.has(aspectProps.classFullName))
|
|
2593
2660
|
aspects.push(this._iModel.constructEntity(aspectProps));
|
|
2594
2661
|
}
|
|
@@ -2603,9 +2670,9 @@ function processSchemaWriteStatus(status) {
|
|
|
2603
2670
|
*/
|
|
2604
2671
|
getAspects(elementId, aspectClassFullName, excludedClassFullNames) {
|
|
2605
2672
|
if (aspectClassFullName === undefined) {
|
|
2606
|
-
const allAspects = this.runInstanceQuery(`SELECT $ FROM (
|
|
2607
|
-
SELECT ECInstanceId, ECClassId FROM Bis.ElementMultiAspect WHERE Element.Id = :elementId
|
|
2608
|
-
UNION ALL
|
|
2673
|
+
const allAspects = this.runInstanceQuery(`SELECT $ FROM (
|
|
2674
|
+
SELECT ECInstanceId, ECClassId FROM Bis.ElementMultiAspect WHERE Element.Id = :elementId
|
|
2675
|
+
UNION ALL
|
|
2609
2676
|
SELECT ECInstanceId, ECClassId FROM Bis.ElementUniqueAspect WHERE Element.Id = :elementId) OPTIONS USE_JS_PROP_NAMES DO_NOT_TRUNCATE_BLOB`, elementId, excludedClassFullNames);
|
|
2610
2677
|
if (allAspects.length === 0)
|
|
2611
2678
|
Logger.logInfo(BackendLoggerCategory.ECDb, `No aspects found for class ${aspectClassFullName} and element ${elementId}`);
|
|
@@ -2624,7 +2691,7 @@ function processSchemaWriteStatus(status) {
|
|
|
2624
2691
|
let classIdList = IModelDb.Elements.classMap.get(aspectClassFullName);
|
|
2625
2692
|
if (classIdList === undefined) {
|
|
2626
2693
|
const classIds = [];
|
|
2627
|
-
const sql = `select SourceECInstanceId from meta.ClassHasAllBaseClasses where TargetECInstanceId = (select ECInstanceId from meta.ECClassDef where Name=:className
|
|
2694
|
+
const sql = `select SourceECInstanceId from meta.ClassHasAllBaseClasses where TargetECInstanceId = (select ECInstanceId from meta.ECClassDef where Name=:className
|
|
2628
2695
|
and Schema.Id = (select ECInstanceId from meta.ECSchemaDef where Name=:schemaName)) and SourceECInstanceId != TargetECInstanceId`;
|
|
2629
2696
|
this._iModel.withQueryReader(sql, (reader) => {
|
|
2630
2697
|
for (const row of reader) {
|
|
@@ -2643,22 +2710,72 @@ function processSchemaWriteStatus(status) {
|
|
|
2643
2710
|
return [];
|
|
2644
2711
|
}
|
|
2645
2712
|
// Execute an instance query to retrieve all aspects from all the derived classes
|
|
2646
|
-
const aspects = this.runInstanceQuery(`SELECT $ FROM (
|
|
2647
|
-
SELECT ECInstanceId, ECClassId FROM Bis.ElementMultiAspect WHERE Element.Id = :elementId AND ECClassId IN (${classIdList})
|
|
2648
|
-
UNION ALL
|
|
2649
|
-
SELECT ECInstanceId, ECClassId FROM Bis.ElementUniqueAspect WHERE Element.Id = :elementId AND ECClassId IN (${classIdList})
|
|
2713
|
+
const aspects = this.runInstanceQuery(`SELECT $ FROM (
|
|
2714
|
+
SELECT ECInstanceId, ECClassId FROM Bis.ElementMultiAspect WHERE Element.Id = :elementId AND ECClassId IN (${classIdList})
|
|
2715
|
+
UNION ALL
|
|
2716
|
+
SELECT ECInstanceId, ECClassId FROM Bis.ElementUniqueAspect WHERE Element.Id = :elementId AND ECClassId IN (${classIdList})
|
|
2650
2717
|
) OPTIONS USE_JS_PROP_NAMES DO_NOT_TRUNCATE_BLOB`, elementId, excludedClassFullNames);
|
|
2651
2718
|
if (aspects.length === 0)
|
|
2652
2719
|
Logger.logInfo(BackendLoggerCategory.ECDb, `No aspects found for class ${aspectClassFullName} and element ${elementId}`);
|
|
2653
2720
|
return aspects;
|
|
2654
2721
|
}
|
|
2722
|
+
/** Stream the [[ElementAspect]] instances owned by a set of elements.
|
|
2723
|
+
*
|
|
2724
|
+
* Use this method instead of calling [[getAspects]] repeatedly when reading aspects for multiple elements or when the result may be large. The query reads all requested owners together and yields each aspect without buffering the complete result set. For a single element with a small result, [[getAspects]] provides a simpler synchronous API.
|
|
2725
|
+
*
|
|
2726
|
+
* The order is unspecified unless [[QueryAspectOptions.groupByOwner]] is true.
|
|
2727
|
+
* @param options Defines the element Ids, class filters, result ordering, and query connection.
|
|
2728
|
+
* @returns An async iterator over the matching aspects.
|
|
2729
|
+
* @beta
|
|
2730
|
+
*/
|
|
2731
|
+
async *queryAspects(options) {
|
|
2732
|
+
const elementIds = Id64.toIdSet(options.elementIds);
|
|
2733
|
+
if (elementIds.size === 0)
|
|
2734
|
+
return;
|
|
2735
|
+
const params = new QueryBinder().bindIdSet("elementIds", elementIds);
|
|
2736
|
+
const classFilter = options.aspectClassFullName === undefined ? "" : `AND aspect.ECClassId IN (
|
|
2737
|
+
SELECT SourceECInstanceId FROM meta.ClassHasAllBaseClasses
|
|
2738
|
+
WHERE TargetECInstanceId=ec_classid(:aspectClassFullName)
|
|
2739
|
+
)`;
|
|
2740
|
+
if (options.aspectClassFullName !== undefined)
|
|
2741
|
+
params.bindString("aspectClassFullName", options.aspectClassFullName.replace(".", ":"));
|
|
2742
|
+
const excludedClassIds = [];
|
|
2743
|
+
let excludedClassIndex = 0;
|
|
2744
|
+
for (const classFullName of options.excludedAspectClassFullNames ?? []) {
|
|
2745
|
+
const parameterName = `excludedAspectClass${excludedClassIndex++}`;
|
|
2746
|
+
excludedClassIds.push(`ec_classid(:${parameterName})`);
|
|
2747
|
+
params.bindString(parameterName, classFullName.replace(".", ":"));
|
|
2748
|
+
}
|
|
2749
|
+
const excludedClassFilter = excludedClassIds.length === 0 ? "" : `AND aspect.ECClassId NOT IN (
|
|
2750
|
+
SELECT ECInstanceId FROM meta.ECClassDef WHERE ECInstanceId IN (${excludedClassIds.join(",")})
|
|
2751
|
+
)`;
|
|
2752
|
+
const orderBy = options.groupByOwner
|
|
2753
|
+
? "ORDER BY OwnerId, AspectKind, ECClassId, ECInstanceId"
|
|
2754
|
+
: "";
|
|
2755
|
+
const sql = `WITH OwnerIds AS (SELECT id FROM IdSet(:elementIds))
|
|
2756
|
+
SELECT $ FROM (
|
|
2757
|
+
SELECT aspect.ECInstanceId, aspect.ECClassId, aspect.Element.Id AS OwnerId, 0 AS AspectKind
|
|
2758
|
+
FROM OwnerIds owners
|
|
2759
|
+
CROSS JOIN Bis.ElementMultiAspect aspect ON aspect.Element.Id=owners.id
|
|
2760
|
+
WHERE TRUE ${classFilter} ${excludedClassFilter}
|
|
2761
|
+
UNION ALL
|
|
2762
|
+
SELECT aspect.ECInstanceId, aspect.ECClassId, aspect.Element.Id AS OwnerId, 1 AS AspectKind
|
|
2763
|
+
FROM OwnerIds owners
|
|
2764
|
+
CROSS JOIN Bis.ElementUniqueAspect aspect ON aspect.Element.Id=owners.id
|
|
2765
|
+
WHERE TRUE ${classFilter} ${excludedClassFilter}
|
|
2766
|
+
) ${orderBy}
|
|
2767
|
+
OPTIONS USE_JS_PROP_NAMES DO_NOT_TRUNCATE_BLOB`;
|
|
2768
|
+
const reader = this._iModel.createQueryReader(sql, params, { usePrimaryConn: options.usePrimaryConn });
|
|
2769
|
+
for await (const queryRow of reader)
|
|
2770
|
+
yield this._iModel.constructEntity(this.getAspectPropsFromInstanceQuery(queryRow[0]));
|
|
2771
|
+
}
|
|
2655
2772
|
/** Insert a new ElementAspect into the iModel.
|
|
2656
2773
|
* @param aspectProps The properties of the new ElementAspect.
|
|
2657
2774
|
* @throws [[IModelError]] if unable to insert the ElementAspect.
|
|
2658
2775
|
* @returns the id of the newly inserted aspect.
|
|
2659
2776
|
* @note Aspect Ids may collide with element Ids, so don't put both in a container like Set or Map
|
|
2660
2777
|
* use [EntityReference]($common) for that instead.
|
|
2661
|
-
* @deprecated in 5.9.0 -
|
|
2778
|
+
* @deprecated in 5.9.0 - might be removed in next major version. Use EditTxn.insertAspect instead, within an explicit EditTxn scope (or via withEditTxn). See EditTxn documentation for migration help.
|
|
2662
2779
|
*/
|
|
2663
2780
|
insertAspect(aspectProps) {
|
|
2664
2781
|
return this._iModel[_implicitTxn].insertAspect(aspectProps);
|
|
@@ -2666,7 +2783,7 @@ function processSchemaWriteStatus(status) {
|
|
|
2666
2783
|
/** Update an exist ElementAspect within the iModel.
|
|
2667
2784
|
* @param aspectProps The properties to use to update the ElementAspect.
|
|
2668
2785
|
* @throws [[IModelError]] if unable to update the ElementAspect.
|
|
2669
|
-
* @deprecated in 5.9.0 -
|
|
2786
|
+
* @deprecated in 5.9.0 - might be removed in next major version. Use EditTxn.updateAspect instead, within an explicit EditTxn scope (or via withEditTxn). See EditTxn documentation for migration help.
|
|
2670
2787
|
*/
|
|
2671
2788
|
updateAspect(aspectProps) {
|
|
2672
2789
|
this._iModel[_implicitTxn].updateAspect(aspectProps);
|
|
@@ -2674,7 +2791,7 @@ function processSchemaWriteStatus(status) {
|
|
|
2674
2791
|
/** Delete one or more ElementAspects from this iModel.
|
|
2675
2792
|
* @param aspectInstanceIds The set of instance Ids of the ElementAspect(s) to be deleted
|
|
2676
2793
|
* @throws [[IModelError]] if unable to delete the ElementAspect.
|
|
2677
|
-
* @deprecated in 5.9.0 -
|
|
2794
|
+
* @deprecated in 5.9.0 - might be removed in next major version. Use EditTxn.deleteAspect instead, within an explicit EditTxn scope (or via withEditTxn). See EditTxn documentation for migration help.
|
|
2678
2795
|
*/
|
|
2679
2796
|
deleteAspect(aspectInstanceIds) {
|
|
2680
2797
|
this._iModel[_implicitTxn].deleteAspect(aspectInstanceIds);
|
|
@@ -2683,7 +2800,7 @@ function processSchemaWriteStatus(status) {
|
|
|
2683
2800
|
* @param props The properties specifying the element to reparent and its new parent.
|
|
2684
2801
|
* @throws [[ITwinError]] if the operation fails.
|
|
2685
2802
|
* @beta
|
|
2686
|
-
* @deprecated in 5.11.0 -
|
|
2803
|
+
* @deprecated in 5.11.0 - might be removed in next major version. Use EditTxn.changeElementParent instead, within an explicit EditTxn scope (or via withEditTxn). See EditTxn documentation for migration help.
|
|
2687
2804
|
*/
|
|
2688
2805
|
changeElementParent(props) {
|
|
2689
2806
|
this._iModel[_implicitTxn].changeElementParent(props);
|
|
@@ -2692,7 +2809,7 @@ function processSchemaWriteStatus(status) {
|
|
|
2692
2809
|
* @param props The properties specifying the element to move and its new model.
|
|
2693
2810
|
* @throws [[ITwinError]] if the operation fails.
|
|
2694
2811
|
* @beta
|
|
2695
|
-
* @deprecated in 5.11.0 -
|
|
2812
|
+
* @deprecated in 5.11.0 - might be removed in next major version. Use EditTxn.changeElementModel instead, within an explicit EditTxn scope (or via withEditTxn). See EditTxn documentation for migration help.
|
|
2696
2813
|
*/
|
|
2697
2814
|
changeElementModel(props) {
|
|
2698
2815
|
this._iModel[_implicitTxn].changeElementModel(props);
|
|
@@ -2711,15 +2828,27 @@ function processSchemaWriteStatus(status) {
|
|
|
2711
2828
|
static viewStoreProperty = { namespace: "itwinjs", name: "DefaultViewStore" };
|
|
2712
2829
|
_viewStore;
|
|
2713
2830
|
get hasViewStore() { return undefined !== this._viewStore; }
|
|
2714
|
-
/**
|
|
2831
|
+
/** The [[ViewStore.CloudAccess]] for this iModel.
|
|
2832
|
+
* @note The iModel owns its ViewStore (whether assigned via this setter or created by [[accessViewStore]]): it is closed when the iModel is closed.
|
|
2833
|
+
* @beta
|
|
2834
|
+
*/
|
|
2715
2835
|
get viewStore() {
|
|
2716
2836
|
if (undefined === this._viewStore)
|
|
2717
2837
|
throw new IModelError(IModelStatus.BadRequest, "No ViewStore available");
|
|
2718
2838
|
return this._viewStore;
|
|
2719
2839
|
}
|
|
2720
2840
|
set viewStore(viewStore) {
|
|
2841
|
+
if (this._viewStore !== undefined && this._viewStore !== viewStore)
|
|
2842
|
+
this._viewStore.close();
|
|
2721
2843
|
this._viewStore = viewStore;
|
|
2722
2844
|
}
|
|
2845
|
+
/** Close the ViewStore for this iModel, if one is open. Called when the iModel is closed.
|
|
2846
|
+
* @internal
|
|
2847
|
+
*/
|
|
2848
|
+
[_close]() {
|
|
2849
|
+
this._viewStore?.close();
|
|
2850
|
+
this._viewStore = undefined;
|
|
2851
|
+
}
|
|
2723
2852
|
/** @beta */
|
|
2724
2853
|
async accessViewStore(args) {
|
|
2725
2854
|
let props = args.props;
|
|
@@ -2739,7 +2868,7 @@ function processSchemaWriteStatus(status) {
|
|
|
2739
2868
|
return this._viewStore;
|
|
2740
2869
|
}
|
|
2741
2870
|
/**
|
|
2742
|
-
* @beta @deprecated in 5.9.0 -
|
|
2871
|
+
* @beta @deprecated in 5.9.0 - might be removed in next major version. Use EditTxn.saveDefaultViewStore instead, within an explicit EditTxn scope (or via withEditTxn). See EditTxn documentation for migration help.
|
|
2743
2872
|
*/
|
|
2744
2873
|
saveDefaultViewStore(arg) {
|
|
2745
2874
|
this._iModel[_implicitTxn].saveDefaultViewStore(arg);
|
|
@@ -2757,7 +2886,9 @@ function processSchemaWriteStatus(status) {
|
|
|
2757
2886
|
try {
|
|
2758
2887
|
props.push(imodel.elements.getElementProps(id));
|
|
2759
2888
|
}
|
|
2760
|
-
catch {
|
|
2889
|
+
catch {
|
|
2890
|
+
return;
|
|
2891
|
+
}
|
|
2761
2892
|
});
|
|
2762
2893
|
return props;
|
|
2763
2894
|
}
|
|
@@ -2780,7 +2911,9 @@ function processSchemaWriteStatus(status) {
|
|
|
2780
2911
|
break;
|
|
2781
2912
|
}
|
|
2782
2913
|
}
|
|
2783
|
-
catch {
|
|
2914
|
+
catch {
|
|
2915
|
+
continue;
|
|
2916
|
+
}
|
|
2784
2917
|
}
|
|
2785
2918
|
return finished;
|
|
2786
2919
|
}
|
|
@@ -2990,9 +3123,6 @@ export class BriefcaseDb extends IModelDb {
|
|
|
2990
3123
|
get isBriefcase() { return true; }
|
|
2991
3124
|
/* the BriefcaseId of the briefcase opened with this BriefcaseDb */
|
|
2992
3125
|
briefcaseId;
|
|
2993
|
-
_skipSyncSchemasOnPullAndPush;
|
|
2994
|
-
/** @internal */
|
|
2995
|
-
get skipSyncSchemasOnPullAndPush() { return this._skipSyncSchemasOnPullAndPush ?? false; }
|
|
2996
3126
|
/**
|
|
2997
3127
|
* Event raised just before a BriefcaseDb is opened. Supplies the arguments that will be used to open the BriefcaseDb.
|
|
2998
3128
|
* Throw an exception to stop the open.
|
|
@@ -3075,6 +3205,8 @@ export class BriefcaseDb extends IModelDb {
|
|
|
3075
3205
|
}
|
|
3076
3206
|
constructor(args) {
|
|
3077
3207
|
super({ ...args, changeset: args.nativeDb.getCurrentChangeset() });
|
|
3208
|
+
// Native invokes this private callback dynamically through the object registered by IModelDb.
|
|
3209
|
+
void this.onChangesetConflict;
|
|
3078
3210
|
this._openMode = args.openMode;
|
|
3079
3211
|
this.briefcaseId = args.briefcaseId;
|
|
3080
3212
|
this.makeLockControl();
|
|
@@ -3087,26 +3219,33 @@ export class BriefcaseDb extends IModelDb {
|
|
|
3087
3219
|
wasChanges = nativeDb.hasPendingTxns();
|
|
3088
3220
|
nativeDb.closeFile();
|
|
3089
3221
|
};
|
|
3090
|
-
const
|
|
3091
|
-
|
|
3092
|
-
|
|
3093
|
-
}
|
|
3094
|
-
|
|
3222
|
+
const push = async () => {
|
|
3223
|
+
if (wasChanges)
|
|
3224
|
+
await withBriefcaseDb(briefcase, async (db) => db.pushChanges({ ...briefcase, description, retainLocks: true }));
|
|
3225
|
+
};
|
|
3226
|
+
// Asked of the closed file, so an iModel without schema sync never gets opened for this.
|
|
3227
|
+
if (SchemaSync.isEnabled(briefcase)) {
|
|
3228
|
+
await withBriefcaseDb(briefcase, async (db) => SchemaSync.updateDbSchema(db));
|
|
3095
3229
|
await SchemaSync.withLockedAccess(briefcase, { openMode: OpenMode.Readonly, operationName: "schema sync" }, async (syncAccess) => {
|
|
3096
3230
|
const schemaSyncDbUri = syncAccess.getUri();
|
|
3097
3231
|
executeUpgrade();
|
|
3232
|
+
// Overwriting advances the SchemaSync data version, so a no-op upgrade must not call it.
|
|
3233
|
+
if (!wasChanges)
|
|
3234
|
+
return;
|
|
3098
3235
|
await withBriefcaseDb(briefcase, async (db) => {
|
|
3099
|
-
db[_nativeDb].
|
|
3236
|
+
db[_nativeDb].schemaSyncOverwrite(schemaSyncDbUri);
|
|
3100
3237
|
db[_nativeDb].saveChanges();
|
|
3101
3238
|
});
|
|
3102
|
-
|
|
3239
|
+
// Publish the sync db before the changeset while retaining both locks.
|
|
3240
|
+
syncAccess.closeDb();
|
|
3241
|
+
await syncAccess.container.uploadChanges();
|
|
3242
|
+
await push();
|
|
3103
3243
|
});
|
|
3104
3244
|
}
|
|
3105
3245
|
else {
|
|
3106
3246
|
executeUpgrade();
|
|
3247
|
+
await push();
|
|
3107
3248
|
}
|
|
3108
|
-
if (wasChanges)
|
|
3109
|
-
await withBriefcaseDb(briefcase, async (db) => db.pushChanges({ ...briefcase, description, retainLocks: true }));
|
|
3110
3249
|
}
|
|
3111
3250
|
/** Upgrades the schemas in the iModel based on the current version of the software. Follows a sequence of operations -
|
|
3112
3251
|
* * Acquires a schema lock to prevent other users from making any other changes while upgrade is happening
|
|
@@ -3126,6 +3265,22 @@ export class BriefcaseDb extends IModelDb {
|
|
|
3126
3265
|
// - push changes
|
|
3127
3266
|
// - release schema lock
|
|
3128
3267
|
// good thing computers are fast. Fortunately upgrading should be rare (and the push time will dominate anyway.) Don't try to optimize any of this away.
|
|
3268
|
+
// schemaSyncOverwrite can discard unpushed imports, so hold the exclusive lock across both upgrades.
|
|
3269
|
+
if (SchemaSync.isEnabled(briefcase)) {
|
|
3270
|
+
try {
|
|
3271
|
+
await withBriefcaseDb(briefcase, async (db) => {
|
|
3272
|
+
if (!db.locks.isServerBased)
|
|
3273
|
+
throw new IModelError(DbResult.BE_SQLITE_ERROR, "Cannot upgrade schemas with SchemaSync without server-based locking");
|
|
3274
|
+
await db.acquireSchemaLock();
|
|
3275
|
+
});
|
|
3276
|
+
await this.doUpgrade(briefcase, { profile: ProfileOptions.Upgrade, schemaLockHeld: true }, "Upgraded profile");
|
|
3277
|
+
await this.doUpgrade(briefcase, { domain: DomainOptions.Upgrade, schemaLockHeld: true }, "Upgraded domain schemas");
|
|
3278
|
+
}
|
|
3279
|
+
finally {
|
|
3280
|
+
await withBriefcaseDb(briefcase, async (db) => db.locks[_releaseAllLocks]());
|
|
3281
|
+
}
|
|
3282
|
+
return;
|
|
3283
|
+
}
|
|
3129
3284
|
try {
|
|
3130
3285
|
await this.doUpgrade(briefcase, { profile: ProfileOptions.Upgrade }, "Upgraded profile");
|
|
3131
3286
|
}
|
|
@@ -3190,6 +3345,7 @@ export class BriefcaseDb extends IModelDb {
|
|
|
3190
3345
|
}
|
|
3191
3346
|
// load all of the settings from workspaces
|
|
3192
3347
|
await briefcaseDb.loadWorkspaceSettings();
|
|
3348
|
+
await briefcaseDb.initializeSharedElementReservations();
|
|
3193
3349
|
if (openMode === OpenMode.ReadWrite && CodeService.createForIModel) {
|
|
3194
3350
|
try {
|
|
3195
3351
|
briefcaseDb._codeService = await CodeService.createForIModel(briefcaseDb);
|
|
@@ -3245,6 +3401,18 @@ export class BriefcaseDb extends IModelDb {
|
|
|
3245
3401
|
return "foreign key";
|
|
3246
3402
|
}
|
|
3247
3403
|
};
|
|
3404
|
+
// `dgn_Domain` holds one bookkeeping row per BIS domain present in the briefcase. The row is
|
|
3405
|
+
// created automatically as soon as the domain's schema is imported, so merging a changeset
|
|
3406
|
+
// that registers a domain inserts a row that was just created locally. Both rows describe the
|
|
3407
|
+
// same domain and the incoming one is authoritative, so this duplicate insert is never fatal.
|
|
3408
|
+
// Only a primary key collision on an insert is benign - an update or delete whose "before"
|
|
3409
|
+
// values do not match (`DbConflictCause.Data`) describes a real divergence and must not be
|
|
3410
|
+
// silently discarded here.
|
|
3411
|
+
if (args.tableName === "dgn_Domain" && args.cause === DbConflictCause.Conflict && args.opcode === DbOpcode.Insert) {
|
|
3412
|
+
Logger.logWarning(category, `${interpretConflictCause(args.cause)} conflict on dgn_Domain - resolved by replacing the existing row with the incoming row`);
|
|
3413
|
+
args.dump();
|
|
3414
|
+
return DbConflictResolution.Replace;
|
|
3415
|
+
}
|
|
3248
3416
|
if (args.cause === DbConflictCause.Data && !args.indirect) {
|
|
3249
3417
|
/*
|
|
3250
3418
|
* From SQLite Docs CHANGESET_DATA as the second argument
|
|
@@ -3413,10 +3581,12 @@ export class BriefcaseDb extends IModelDb {
|
|
|
3413
3581
|
async pullChanges(arg) {
|
|
3414
3582
|
await this.executeWritable(async () => {
|
|
3415
3583
|
await BriefcaseManager.pullAndApplyChangesets(this, arg ?? {});
|
|
3416
|
-
|
|
3417
|
-
await SchemaSync.pull(this);
|
|
3584
|
+
SchemaSync.updateDbSchema(this);
|
|
3418
3585
|
this.initializeIModelDb("pullMerge");
|
|
3419
3586
|
});
|
|
3587
|
+
// If this pull enabled or disabled SchemaSync for this briefcase, its reservations must now be re-initialized
|
|
3588
|
+
if (this.reservations.isServerBased !== SchemaSync.isEnabled(this))
|
|
3589
|
+
await this.initializeSharedElementReservations();
|
|
3420
3590
|
this.txns._onChangesPulled(this.changeset);
|
|
3421
3591
|
}
|
|
3422
3592
|
async enableChangesetStatTracking() {
|
|
@@ -3496,24 +3666,10 @@ export class BriefcaseDb extends IModelDb {
|
|
|
3496
3666
|
if (nativeDb.hasPendingTxns()) {
|
|
3497
3667
|
throw new IModelError(ChangeSetStatus.HasLocalChanges, "Cannot revert with pending txns");
|
|
3498
3668
|
}
|
|
3499
|
-
const skipSchemaSyncPull = async (func) => {
|
|
3500
|
-
if (nativeDb.schemaSyncEnabled()) {
|
|
3501
|
-
this._skipSyncSchemasOnPullAndPush = true;
|
|
3502
|
-
try {
|
|
3503
|
-
return await func();
|
|
3504
|
-
}
|
|
3505
|
-
finally {
|
|
3506
|
-
this._skipSyncSchemasOnPullAndPush = undefined;
|
|
3507
|
-
}
|
|
3508
|
-
}
|
|
3509
|
-
else {
|
|
3510
|
-
return func();
|
|
3511
|
-
}
|
|
3512
|
-
};
|
|
3513
3669
|
this.clearCaches();
|
|
3514
|
-
await
|
|
3670
|
+
await this.pullChanges({ ...arg, toIndex: undefined });
|
|
3515
3671
|
await this.acquireSchemaLock();
|
|
3516
|
-
if (
|
|
3672
|
+
if (SchemaSync.isEnabled(this)) {
|
|
3517
3673
|
arg.skipSchemaChanges = true;
|
|
3518
3674
|
}
|
|
3519
3675
|
// The native side enables file-based txns during revert. Restore the original setting afterward.
|
|
@@ -3534,7 +3690,7 @@ export class BriefcaseDb extends IModelDb {
|
|
|
3534
3690
|
pushRetryDelay: arg.pushRetryDelay,
|
|
3535
3691
|
retainLocks: arg.retainLocks,
|
|
3536
3692
|
};
|
|
3537
|
-
await
|
|
3693
|
+
await this.pushChanges(pushArgs);
|
|
3538
3694
|
this.clearCaches();
|
|
3539
3695
|
}
|
|
3540
3696
|
catch (err) {
|
|
@@ -3605,9 +3761,62 @@ export class BriefcaseDb extends IModelDb {
|
|
|
3605
3761
|
await BriefcaseManager.pullMergePush(this, arg);
|
|
3606
3762
|
this.initializeIModelDb("pullMerge");
|
|
3607
3763
|
});
|
|
3764
|
+
// If this pull enabled or disabled SchemaSync for this briefcase, its reservations must now be re-initialized
|
|
3765
|
+
if (this.reservations.isServerBased !== SchemaSync.isEnabled(this))
|
|
3766
|
+
await this.initializeSharedElementReservations();
|
|
3608
3767
|
this.txns._onChangesPushed(this.changeset);
|
|
3609
3768
|
BriefcaseManager.deleteRebaseFolders(this);
|
|
3610
3769
|
}
|
|
3770
|
+
/** Import schemas while allowing changes that move or delete data.
|
|
3771
|
+
*
|
|
3772
|
+
* Takes the exclusive schema lock, requires the briefcase to be at the timeline tip, imports, updates the sync db, and pushes the result.
|
|
3773
|
+
* @note The briefcase must have no local changes.
|
|
3774
|
+
* @see [[BriefcaseDb.upgradeSchemas]] (static) for upgrading the software's profile and domain schemas.
|
|
3775
|
+
* @alpha
|
|
3776
|
+
*/
|
|
3777
|
+
async upgradeSchemas(schemaFileNames, arg) {
|
|
3778
|
+
return this.upgradeSchemasInternal(schemaFileNames, arg, (schemas, importOptions) => this[_nativeDb].importSchemas(schemas, importOptions));
|
|
3779
|
+
}
|
|
3780
|
+
/** The [[importSchemaStrings]] counterpart of [[upgradeSchemas]].
|
|
3781
|
+
* @alpha
|
|
3782
|
+
*/
|
|
3783
|
+
async upgradeSchemaStrings(serializedXmlSchemas, arg) {
|
|
3784
|
+
return this.upgradeSchemasInternal(serializedXmlSchemas, arg, (schemas, importOptions) => this[_nativeDb].importXmlSchemas(schemas, importOptions));
|
|
3785
|
+
}
|
|
3786
|
+
async upgradeSchemasInternal(schemas, arg, nativeImportOp) {
|
|
3787
|
+
if (schemas.length === 0)
|
|
3788
|
+
return;
|
|
3789
|
+
this.assertCanImportSchemas();
|
|
3790
|
+
if (this[_nativeDb].hasUnsavedChanges() || this.txns.hasLocalChanges)
|
|
3791
|
+
throw new IModelError(ChangeSetStatus.HasLocalChanges, "Cannot upgrade schemas while there are local changes");
|
|
3792
|
+
if (SchemaSync.isEnabled(this) && !this.locks.isServerBased)
|
|
3793
|
+
throw new IModelError(DbResult.BE_SQLITE_ERROR, "Cannot upgrade schemas with SchemaSync without server-based locking");
|
|
3794
|
+
await this.acquireSchemaLock();
|
|
3795
|
+
await this.pullChanges({ accessToken: arg.accessToken });
|
|
3796
|
+
if (!SchemaSync.isEnabled(this)) {
|
|
3797
|
+
await this.importSchemasInternal(schemas, { ecSchemaXmlContext: arg.ecSchemaXmlContext }, nativeImportOp);
|
|
3798
|
+
await this.pushChanges(arg);
|
|
3799
|
+
return;
|
|
3800
|
+
}
|
|
3801
|
+
await SchemaSync.withLockedAccess(this, { openMode: OpenMode.Readonly, operationName: "schema upgrade" }, async (syncAccess) => {
|
|
3802
|
+
this.saveSchemaChanges();
|
|
3803
|
+
try {
|
|
3804
|
+
nativeImportOp(schemas, {
|
|
3805
|
+
schemaLockHeld: true,
|
|
3806
|
+
ecSchemaXmlContext: arg.ecSchemaXmlContext?.nativeContext,
|
|
3807
|
+
schemaSyncDbUri: syncAccess.getUri(),
|
|
3808
|
+
});
|
|
3809
|
+
}
|
|
3810
|
+
catch (err) {
|
|
3811
|
+
this.abandonSchemaChanges();
|
|
3812
|
+
throw new IModelError(err.errorNumber, err.message);
|
|
3813
|
+
}
|
|
3814
|
+
this.clearCaches();
|
|
3815
|
+
syncAccess.closeDb();
|
|
3816
|
+
await syncAccess.container.uploadChanges();
|
|
3817
|
+
await this.pushChanges(arg);
|
|
3818
|
+
});
|
|
3819
|
+
}
|
|
3611
3820
|
close(options) {
|
|
3612
3821
|
if (this.isBriefcase && this.isOpen && !this.isReadonly && this.txns.rebaser.inProgress()) {
|
|
3613
3822
|
this[_nativeDb].abandonChanges();
|
|
@@ -3779,6 +3988,7 @@ export class SnapshotDb extends IModelDb {
|
|
|
3779
3988
|
const key = CheckpointManager.getKey(checkpoint);
|
|
3780
3989
|
const db = SnapshotDb.openFile(dbName, { key, container });
|
|
3781
3990
|
await db.loadWorkspaceSettings();
|
|
3991
|
+
await db.initializeSharedElementReservations();
|
|
3782
3992
|
return db;
|
|
3783
3993
|
}
|
|
3784
3994
|
/** @internal */
|