BriefcaseDb Class

A local copy of an iModel from iModelHub.

BriefcaseDb raises a set of events to allow apps and subsystems to track its object life cycle, including BriefcaseDb.onOpen and BriefcaseDb.onOpened.




Name Description
close(): void Close this IModel, if it is currently open.  
pullAndMergeChanges(requestContext: AuthorizedClientRequestContext, version: IModelVersion = IModelVersion.latest()): Promise<void> Pull and Merge changes from iModelHub  
pushChanges(requestContext: AuthorizedClientRequestContext, description: string): Promise<void> Push changes to iModelHub.  
reinstateChanges(requestContext: AuthorizedClientRequestContext, version: IModelVersion = IModelVersion.latest()): Promise<void> Reinstate a previously reversed set of changes  
reverseChanges(requestContext: AuthorizedClientRequestContext, version: IModelVersion = IModelVersion.latest()): Promise<void> Reverse a previously merged set of changes  
saveChanges(description?: string): void Commit pending changes to this iModel.  
open(requestContext: AuthorizedClientRequestContext | ClientRequestContext, briefcaseKey: BriefcaseKey, openOptions?: OpenBriefcaseOptions): Promise<BriefcaseDb> Static Open a previously downloaded briefcase  

Inherited methods

Name Inherited from Description
abandonChanges(): void IModelDb Abandon pending changes in this iModel
cancelSnap(sessionId: string): void IModelDb Cancel a previously requested snap.
cartographicToSpatialFromEcef(cartographic: Cartographic, result?: Point3d): Point3d IModel Convert a Cartographic to a point in this iModel's Spatial coordinates using its ecefLocation.
clearSqliteStatementCache(): void IModelDb Empty the SqliteStatementCache for this iModel.
clearStatementCache(): void IModelDb Empty the ECSqlStatementCache for this iModel.
constructEntity<T extends Entity>(props: EntityProps): T extends Entity IModelDb Construct an entity (Element or Model) from an iModel.
containsClass(classFullName: string): boolean IModelDb Query if this iModel contains the definition of the specified class.
deleteFileProperty(prop: FilePropertyProps): DbResult IModelDb delete a "file property" from this iModel
ecefToSpatial(ecef: XYAndZ, result?: Point3d): Point3d IModel Convert a point in ECEF coordinates to a point in this iModel's Spatial coordinates using its ecefLocation.
embedFont(prop: FontProps): FontProps IModelDb  
exportGraphics(exportProps: ExportGraphicsOptions): DbResult IModelDb Export meshes suitable for graphics APIs from arbitrary geometry in elements in this IModelDb.
exportPartGraphics(exportProps: ExportPartGraphicsOptions): DbResult IModelDb Exports meshes suitable for graphics APIs from a specified GeometryPart
getBriefcaseId(): BriefcaseId IModelDb Get the briefcase Id of this iModel
getEcefTransform(): Transform IModel Get the Transform from this iModel's Spatial coordinates to ECEF coordinates using its ecefLocation.
getGeoCoordinatesFromIModelCoordinates(requestContext: ClientRequestContext, props: string): Promise<GeoCoordinatesResponseProps> IModelDb Get the GeoCoordinate (longitude, latitude, elevation) corresponding to each IModel Coordinate point in the input
getGuid(): GuidString IModelDb Get the GUID of this iModel.
getIModelCoordinatesFromGeoCoordinates(requestContext: ClientRequestContext, props: string): Promise<IModelCoordinatesResponseProps> IModelDb Get the IModel coordinate corresponding to each GeoCoordinate point in the input
getJsClass<T extends undefined>(classFullName: string): T extends undefined IModelDb Get the JavaScript class that handles a given entity class.
getMassProperties(requestContext: ClientRequestContext, props: MassPropertiesRequestProps): Promise<MassPropertiesResponseProps> IModelDb Get the mass properties for the supplied elements
IModelDb Get metadata for a class.
getRpcProps(): IModelRpcProps IModel Return a token that can be used to identify this iModel for RPC operations.
importSchemas(requestContext: ClientRequestContext | AuthorizedClientRequestContext, schemaFileNames: string[]): Promise<void> IModelDb Import an ECSchema.
isBriefcaseDb(): this IModelDb Type guard for instanceof BriefcaseDb
isSnapshotDb(): this IModelDb Type guard for instanceof SnapshotDb
prepareStatement(sql: string): ECSqlStatement IModelDb Prepare an ECSQL statement.
query(ecsql: string, bindings?: any[] | object, limitRows?: number, quota?: QueryQuota, priority?: QueryPriority): AsyncIterableIterator<any> IModelDb Execute a query and stream its results
queryEntityIds(params: EntityQueryParams): Id64Set IModelDb Query for a set of entity ids, given an EntityQueryParams
queryFilePropertyBlob(prop: FilePropertyProps): Uint8Array | undefined IModelDb Query a "file property" from this iModel, as a blob.
queryFilePropertyString(prop: FilePropertyProps): string | undefined IModelDb Query a "file property" from this iModel, as a string.
queryNextAvailableFileProperty(prop: FilePropertyProps): number IModelDb Query for the next available major id for a "file property" from this iModel.
queryRowCount(ecsql: string, bindings?: any[] | object): Promise<number> IModelDb Compute number of rows that would be returned by the ECSQL.
querySchemaVersion(schemaName: string): string | undefined IModelDb Query for a schema of the specified name in this iModel.
readFontJson(): string IModelDb  
requestSnap(requestContext: ClientRequestContext, sessionId: string, props: SnapRequestProps): Promise<SnapResponseProps> IModelDb  
saveFileProperty(prop: FilePropertyProps, strValue: string | undefined, blobVal?: Uint8Array): DbResult IModelDb Save a "file property" to this iModel
setEcefLocation(ecef: EcefLocationProps): void IModel Set the EcefLocation for this iModel.
spatialToCartographicFromEcef(spatial: XYAndZ, result?: Cartographic): Cartographic IModel Convert a point in this iModel's Spatial coordinates to a Cartographic using its ecefLocation.
spatialToEcef(spatial: XYAndZ, result?: Point3d): Point3d IModel Convert a point in this iModel's Spatial coordinates to an ECEF point using its ecefLocation.
tryPrepareStatement(sql: string): ECSqlStatement | undefined IModelDb Prepare an ECSQL statement.
updateEcefLocation(ecef: EcefLocation): void IModelDb Update the EcefLocation of this iModel.
updateIModelProps(): void IModelDb Update the IModelProps of this iModel in the database.
updateProjectExtents(newExtents: AxisAlignedBox3d): void IModelDb Update the project extents for this iModel.
withPreparedStatement<T>(ecsql: string, callback: (stmt: ECSqlStatement) => T): T IModelDb Use a prepared ECSQL statement.
IModelDb Invoke a callback on each property of the specified class, optionally including superclass properties.
getDefaultSubCategoryId(categoryId: Id64String): Id64String Static IModel Get the default subCategoryId for the supplied categoryId


Name Type Description
briefcaseKey Accessor ReadOnly BriefcaseKey Get the key of this briefcase in the cache Beta
changeSetId Accessor string Id of the last ChangeSet that was applied to this iModel.  
concurrencyControl Accessor ReadOnly ConcurrencyControl Get the ConcurrencyControl for this iModel. Beta
contextId Accessor ReadOnly GuidString The Guid that identifies the context that owns this iModel.  
onBeforeClose BeEvent<() => void> Event called when the iModel is about to be closed  
onChangesetApplied BeEvent<() => void> Event called after a changeset is applied to this IModelDb.  
onCreated Static BeEvent<(_imodelDb: BriefcaseDb) => void> Event raised just after a BriefcaseDb is created in iModelHub.  
onOpen Static BeEvent<(_requestContext: AuthorizedClientRequestContext | ClientRequestContext, _briefcaseProps: BriefcaseProps) => void> Event raised just before a BriefcaseDb is opened.  
onOpened Static BeEvent<(_requestContext: AuthorizedClientRequestContext | ClientRequestContext, _imodelDb: BriefcaseDb) => void> Event raised just after a BriefcaseDb is opened.  
syncMode SyncMode Mode of synchronizing changes between the briefcase and iModelHub Beta

Inherited properties

Name Type Inherited from Description
_edit ProtectedStatic "StandaloneEdit" = "StandaloneEdit" IModelDb  
_fontMap Protected undefined | FontMap IModelDb  
codeSpecs Accessor ReadOnly CodeSpecs IModelDb Get the CodeSpecs in this IModel.
defaultLimit Static 1000 IModelDb  
dictionaryId Static Id64String IModel The Id of the dictionary model.
ecefLocation Accessor ReadOnly EcefLocation | undefined IModel The EcefLocation of the iModel in Earth Centered Earth Fixed coordinates.
elements BriefcaseDb.Elements IModelDb  
fontMap Accessor ReadOnly FontMap IModelDb  
globalOrigin Accessor Point3d IModel An offset to be applied to all spatial coordinates.
iModelId Accessor ReadOnly GuidString IModelDb The Guid that identifies this iModel.
isBriefcase Accessor ReadOnly boolean IModelDb Returns true if this is an iModel from iModelHub (briefcase)
isGeoLocated Accessor ReadOnly boolean IModel True if this iModel has an EcefLocation.
isReadonly Accessor ReadOnly boolean IModelDb Check if this iModel has been opened read-only or not.
isSnapshot Accessor ReadOnly boolean IModelDb Returns true if this is a snapshot iModel
maxLimit Static 10000 IModelDb  
models BriefcaseDb.Models IModelDb  
name string IModel Name of the iModel
openMode OpenMode IModel The OpenMode used for this IModel.
projectExtents Accessor AxisAlignedBox3d IModel The volume, in spatial coordinates, inside which the entire project is contained.
relationships Accessor ReadOnly Relationships IModelDb Get the linkTableRelationships for this IModel
repositoryModelId Static Id64String IModel The Id of the repository model.
rootSubject RootSubjectProps IModel The name and description of the root subject of this iModel
rootSubjectId Static Id64String IModel The Id of the root subject element.
tiles BriefcaseDb.Tiles IModelDb  
txns TxnManager IModelDb  
views BriefcaseDb.Views IModelDb  

Defined in

Last Updated: 27 May, 2020