ECDb Class

An ECDb file

Implements

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  
createQueryReader(ecsql: string, params?: QueryBinder, config?: QueryOptions): ECSqlReader Allow to execute query and read results along with meta data.  
dispose(): void Call this function when finished with this ECDb object.  
getSchemaProps(name: string): ECSchemaProps Returns the full schema for the input name.  
importSchema(pathName: string): void Import a schema.  
openDb(pathName: string, openMode: ECDbOpenModeECDbOpenMode.Readonly): void Open the ECDb.  
prepareStatement(ecsql: string, logErrors: booleantrue): ECSqlStatement Prepare an ECSQL statement.  
query(ecsql: string, params?: QueryBinder, options?: QueryOptions): AsyncIterableIterator<any> Execute a query and stream its results Deprecated  
queryRowCount(ecsql: string, params?: QueryBinder): Promise<number> Compute number of rows that would be returned by the ECSQL. Deprecated  
restartQuery(token: string, ecsql: string, params?: QueryBinder, options?: QueryOptions): AsyncIterableIterator<any> Cancel any previous query with same token and run execute the current specified query. Deprecated  
saveChanges(changesetName?: string): void Commit the outermost transaction, writing changes to the file.  
withPreparedSqliteStatement<T>(sql: string, callback: (stmt: SqliteStatement) => T, logErrors: booleantrue): T Use a prepared SQL statement, potentially from the statement cache.  
withPreparedStatement<T>(ecsql: string, callback: (stmt: ECSqlStatement) => T, logErrors: booleantrue): T Use a prepared ECSQL statement, potentially from the statement cache.  
withSqliteStatement<T>(sql: string, callback: (stmt: SqliteStatement) => T, logErrors: booleantrue): T Prepared and execute a callback on a SQL statement.  
withStatement<T>(ecsql: string, callback: (stmt: ECSqlStatement) => T, logErrors: booleantrue): 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

Last Updated: 17 July, 2024