SnapshotDb Class

A snapshot iModel database file that is used for archival and data transfer purposes.

@see - Snapshot iModels

Extends

Methods

Name Description
createEmpty(filePath: string, options: CreateEmptySnapshotIModelProps): SnapshotDb Static Create an empty local Snapshot iModel file.  
createFrom(iModelDb: IModelDb, snapshotFile: string, options?: CreateSnapshotIModelProps): SnapshotDb Static Create a local Snapshot iModel file, using this iModel as a seed or starting point.  
findByKey(key: string): SnapshotDb Static Find an open IModelDb by its key.  
openCheckpoint(args: OpenCheckpointArgs): Promise<SnapshotDb> Static Open a Checkpoint directly from its cloud container.  
openFile(path: string, opts?: SnapshotDbOpenArgs): SnapshotDb Static Open a read-only iModel snapshot.  
tryFindByKey(key: string): undefined | SnapshotDb Static Attempt to find an open IModelDb by key.  

Inherited methods

Name Inherited from Description
abandonChanges(): void IModelDb Abandon pending changes in this iModel.
acquireSchemaLock(): Promise<void> IModelDb Acquire the exclusive schema lock on this iModel.
addNewFont(name: string, type?: FontType): number IModelDb Add a new font name/type to the FontMap for this iModel and return its FontId.
clearCaches(): void IModelDb Clear all in-memory caches held in this IModelDb.
close(): void IModelDb Close this IModel, if it is currently open, and save changes if it was opened in ReadWrite mode.
computeProjectExtents(options?: ComputeProjectExtentsOptions): ComputedProjectExtents IModelDb Compute an appropriate project extents for this iModel based on the ranges of all spatial elements.
constructEntity<T extends Entity, P extends EntityProps>(props: P): T 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.
createQueryReader(ecsql: string, params?: QueryBinder, config?: QueryOptions): ECSqlReader IModelDb Allow to execute query and read results along with meta data.
deleteFileProperty(prop: FilePropertyProps): void IModelDb delete a "file property" from this iModel
deleteSettingDictionary(name: string): void IModelDb Delete a SettingDictionary, previously added with saveSettingDictionary, from this iModel.
elementGeometryCacheOperation(requestProps: ElementGeometryCacheOperationRequestProps): BentleyStatus IModelDb Request operation using the backend geometry cache populated by first calling elementGeometryRequest.
elementGeometryRequest(requestProps: ElementGeometryRequest): IModelStatus IModelDb Request geometry stream information from an element in binary format instead of json.
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
IModelDb Invoke a callback on each property of the specified class, optionally including superclass properties.
generateElementGraphics(request: ElementGraphicsRequestProps): Promise<undefined | Uint8Array> IModelDb Generate graphics for an element or geometry stream.
getBriefcaseId(): number IModelDb Get the briefcase Id of this iModel
getGeoCoordinatesFromIModelCoordinates(props: GeoCoordinatesRequestProps): Promise<GeoCoordinatesResponseProps> IModelDb Get the GeoCoordinate (longitude, latitude, elevation) corresponding to each IModel Coordinate point in the input
getGeometryContainment(props: GeometryContainmentRequestProps): Promise<GeometryContainmentResponseProps> IModelDb Get the clip containment status for the supplied elements.
getIModelCoordinatesFromGeoCoordinates(props: IModelCoordinatesRequestProps): Promise<IModelCoordinatesResponseProps> IModelDb Get the IModel coordinate corresponding to each GeoCoordinate point in the input
getJsClass<T extends >(classFullName: string): T IModelDb Get the JavaScript class that handles a given entity class.
getMassProperties(props: MassPropertiesRequestProps): Promise<MassPropertiesResponseProps> IModelDb Get the mass properties for the supplied elements.
IModelDb Get metadata for a class.
getSchemaProps(name: string): ECSchemaProps IModelDb Returns the full schema for the input name.
importSchemas(schemaFileNames: string[], options?: SchemaImportOptions): Promise<void> IModelDb Import an ECSchema.
isBriefcaseDb(): this is BriefcaseDb IModelDb Type guard for instanceof BriefcaseDb
isSnapshotDb(): this is SnapshotDb IModelDb Type guard for instanceof SnapshotDb
isStandaloneDb(): this is StandaloneDb IModelDb Type guard for instanceof StandaloneDb.
performCheckpoint(): void IModelDb Save all changes and perform a checkpoint on this IModelDb.
prepareStatement(sql: string, logErrors: booleantrue): ECSqlStatement IModelDb Prepare an ECSQL statement.
query(ecsql: string, params?: QueryBinder, options?: QueryOptions): AsyncIterableIterator<any, any, 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): undefined | Uint8Array IModelDb Query a "file property" from this iModel, as a blob.
queryFilePropertyString(prop: FilePropertyProps): undefined | string 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, params?: QueryBinder): Promise<number> IModelDb Compute number of rows that would be returned by the ECSQL.
querySchemaVersion(schemaName: string): undefined | string IModelDb Query for a schema of the specified name in this iModel.
restartQuery(token: string, ecsql: string, params?: QueryBinder, options?: QueryOptions): AsyncIterableIterator<any, any, any> IModelDb Cancel any previous query with same token and run execute the current specified query.
saveChanges(description?: string): void IModelDb Commit pending changes to this iModel.
saveFileProperty(prop: FilePropertyProps, strValue: string, blobVal?: Uint8Array): void IModelDb Save a "file property" to this iModel
saveSettingDictionary(name: string, dict: SettingsContainer): void IModelDb Save a SettingDictionary in this iModel that will be loaded into settings every time this iModel is opened in future sessions.
IModelDb Identical to getMetaData, except it returns undefined instead of throwing an error if the metadata cannot be found nor loaded.
tryPrepareStatement(sql: string): undefined | ECSqlStatement IModelDb Prepare an ECSQL statement.
updateEcefLocation(ecef: EcefLocation): void IModelDb Update the EcefLocation of this iModel.
updateElementGeometryCache(requestProps: ElementGeometryCacheRequestProps): Promise<ElementGeometryCacheResponseProps> IModelDb Request the creation of a backend geometry cache for the specified geometric element.
updateIModelProps(): void IModelDb Update the IModelProps of this iModel in the database.
updateProjectExtents(newExtents: Range3d): void IModelDb Update the project extents for this iModel.
withPreparedSqliteStatement<T>(sql: string, callback: (stmt: SqliteStatement) => T, logErrors: booleantrue): T IModelDb Use a prepared SQL statement, potentially from the statement cache.
withPreparedStatement<T>(ecsql: string, callback: (stmt: ECSqlStatement) => T, logErrors: booleantrue): T IModelDb Use a prepared ECSQL statement, potentially from the statement cache.
withSqliteStatement<T>(sql: string, callback: (stmt: SqliteStatement) => T, logErrors: booleantrue): T IModelDb Prepared and execute a callback on a SQL statement.
withStatement<T>(ecsql: string, callback: (stmt: ECSqlStatement) => T, logErrors: booleantrue): T IModelDb Prepared and execute a callback on an ECSQL statement.
findByFilename(fileName: string): undefined | IModelDb Static IModelDb Find an opened instance of any subclass of IModelDb, by filename
IModelDb Invoke a callback on each property of the specified class, optionally including superclass properties.
validateSchemas(filePath: string, forReadWrite: boolean): SchemaState Static IModelDb Determines if the schemas in the Db must or can be upgraded by comparing them with those included in the

Properties

Name Type Description
isSnapshot Accessor ReadOnly boolean Returns true if this is a SnapshotDb  
onOpen Static Readonly BeEvent<(path: string, opts?: SnapshotDbOpenArgs) => void>    
onOpened Static Readonly BeEvent<(_iModelDb: SnapshotDb) => void>    

Inherited properties

Name Type Inherited from Description
_fontMap Protected FontMap | undefined IModelDb  
channels Readonly ChannelControl IModelDb  
codeSpecs Accessor ReadOnly CodeSpecs IModelDb Get the CodeSpecs in this IModel.
codeValueBehavior Accessor "exact" | "trim-unicode-whitespace" IModelDb Controls how Codes are copied from this iModel into another iModel, to work around problems with iModels
created by older connectors. The imodel-transformer sets this appropriately
on your behalf - you should never need to set or interrogate this property yourself.
defaultLimit Static Readonly "1000" IModelDb  
elements Readonly IModelDb.Elements IModelDb  
fontMap Accessor ReadOnly FontMap IModelDb  
holdsSchemaLock Accessor ReadOnly boolean IModelDb determine whether the schema lock is currently held for this iModel.
iModelId Accessor ReadOnly string IModelDb The Guid that identifies this iModel.
isBriefcase Accessor ReadOnly boolean IModelDb Returns true if this is a BriefcaseDb
isReadonly Accessor ReadOnly boolean IModelDb Check if this iModel has been opened read-only or not.
locks Accessor ReadOnly LockControl IModelDb The LockControl that orchestrates concurrent editing of this iModel.
maxLimit Static Readonly "10000" IModelDb  
models Readonly IModelDb.Models IModelDb  
onBeforeClose Readonly BeEvent<() => void> IModelDb Event called when the iModel is about to be closed.
onChangesetApplied Readonly BeEvent<() => void> IModelDb Event called after a changeset is applied to this IModelDb.
pathName Accessor ReadOnly string IModelDb Get the full path fileName of this iModelDb
relationships Accessor ReadOnly Relationships IModelDb Get the linkTableRelationships for this IModel
tiles Readonly IModelDb.Tiles IModelDb  
views Readonly IModelDb.Views IModelDb  
workspace Accessor ReadOnly Workspace IModelDb Get the Workspace for this iModel.

Defined in

Last Updated: 13 November, 2024