ECDb Class
An ECDb file
Implements
- Disposable
Methods
| Name | Description | |
|---|---|---|
| constructor(): ECDb | ||
| [dispose](): void | Call this function when finished with this ECDb object. | |
| abandonChanges(): void | Abandon (cancel) the outermost transaction, discarding all changes since last save. | |
| attachDb(fileName: string, alias: string): void | Attach an iModel file to this connection and load and register its schemas. | |
| closeDb(): void | Close the Db after saving any uncommitted changes. | |
| createDb(pathName: string): void | Create an ECDb | |
| createQueryReader(ecsql: string, params?: QueryBinder, config?: QueryOptions): ECSqlReader | Allow to execute query and read results along with meta data. | |
| detachDb(alias: string): void | Detach the attached file from this connection. | |
| dispose(): void | Deprecated | |
| getSchemaProps(name: string): ECSchemaProps | Returns the full schema for the input name. | |
| importSchema(pathName: string): void | Import a schema. | |
| openDb(pathName: string, openMode: ECDbOpenMode = ECDbOpenMode.Readonly): void | Open the ECDb. | |
| prepareStatement(ecsql: string, logErrors: boolean = true): ECSqlStatement | Prepare an ECSQL statement. | Deprecated |
| prepareWriteStatement(ecsql: string, logErrors: boolean = true): ECSqlWriteStatement | Prepare an ECSQL statement. | |
| saveChanges(changesetName?: string): void | Commit the outermost transaction, writing changes to the file. | |
| withCachedWriteStatement<T>(ecsql: string, callback: (stmt: ECSqlWriteStatement) => T, logErrors: boolean = true): T | Use a prepared ECSQL statement, potentially from the statement cache. | |
| withPreparedSqliteStatement<T>(sql: string, callback: (stmt: SqliteStatement) => T, logErrors: boolean = true): T | Use a prepared SQL statement, potentially from the statement cache. | |
| withPreparedStatement<T>(ecsql: string, callback: (stmt: ECSqlStatement) => T, logErrors: boolean = true): T | Use a prepared ECSQL statement, potentially from the statement cache. | |
| withSqliteStatement<T>(sql: string, callback: (stmt: SqliteStatement) => T, logErrors: boolean = true): T | Prepared and execute a callback on a SQL statement. | |
| withStatement<T>(ecsql: string, callback: (stmt: ECSqlStatement) => T, logErrors: boolean = true): T | Prepared and execute a callback on an ECSQL statement. | |
| withWriteStatement<T>(ecsql: string, callback: (stmt: ECSqlWriteStatement) => T, logErrors: boolean = true): T | Prepared and execute a callback on an ECSQL statement. |
Properties
| Name | Type | Description | |
|---|---|---|---|
| isOpen Accessor ReadOnly | boolean | Returns true if the ECDb is open |
Defined in
- core/backend/src/ECDb.ts Line 33
Last Updated: 05 February, 2026
Found something wrong, missing, or unclear on this page? Raise an issue in our repo.