API Reference > imodeljs-backend > ECDb > ECDb ECDb Class An ECDb file Implements IDisposable Methods Name Description constructor(): ECDb abandonChanges(): void Abandon (cancel) the outermost transaction, discarding all changes since last save. closeDb(): void Close the Db after saving any uncommitted changes. createDb(pathName: string): void Create an ECDb dispose(): void Call this function when finished with this ECDb object. importSchema(pathName: string): void Import a schema. openDb(pathName: string, openMode: ECDbOpenMode = ECDbOpenMode.Readonly): void Open the ECDb. prepareStatement(ecsql: string): ECSqlStatement Prepare an ECSQL statement. query(ecsql: string, bindings?: object | any[], limitRows?: number, quota?: QueryQuota, priority?: QueryPriority, abbreviateBlobs?: boolean): AsyncIterableIterator<any> Execute a query and stream its results queryRowCount(ecsql: string, bindings?: object | any[]): Promise<number> Compute number of rows that would be returned by the ECSQL. restartQuery(token: string, ecsql: string, bindings?: object | any[], limitRows?: number, quota?: QueryQuota, priority?: QueryPriority): AsyncIterableIterator<any> Execute a query and stream its results saveChanges(changeSetName?: string): void Commit the outermost transaction, writing changes to the file. withPreparedSqliteStatement<T>(sql: string, callback: (stmt: SqliteStatement) => T): T Use a prepared SQL statement, potentially from the statement cache. withPreparedStatement<T>(ecsql: string, callback: (stmt: ECSqlStatement) => T): T Use a prepared ECSQL statement, potentially from the statement cache. withSqliteStatement<T>(sql: string, callback: (stmt: SqliteStatement) => T): T Prepared and execute a callback on a SQL statement. withStatement<T>(ecsql: string, callback: (stmt: ECSqlStatement) => T): 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 34 Last Updated: 29 November, 2022