importSchemas Method

Import an ECSchema. On success, the schema definition is stored in the iModel. This method is asynchronous (must be awaited) because, in the case where this IModelDb is a briefcase, this method first obtains the schema lock from the iModel server. You must import a schema into an iModel before you can insert instances of the classes in that schema. See Element

importSchemas(requestContext: ClientRequestContext | AuthorizedClientRequestContext, schemaFileNames: string[]): Promise<void>

throws IModelError if the schema lock cannot be obtained or there is a problem importing the schema.

note Changes are saved if importSchemas is successful and abandoned if not successful.

see IModelDb.querySchemaVersion

Parameter Type Description
requestContext ClientRequestContext | AuthorizedClientRequestContext The client request context
schemaFileNames string[]  

Returns - Promise<void>

Defined in

Last Updated: 13 June, 2024