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  
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?: any[] | object, limitRows?: number, quota?: QueryQuota, priority?: QueryPriority): AsyncIterableIterator<any> Execute a query and stream its results
The result of the query is async iterator over the rows.
 
queryRowCount(ecsql: string, bindings?: any[] | object): Promise<number> Compute number of rows that would be returned by the ECSQL.  
saveChanges(changeSetName?: string): void Commit the outermost transaction, writing changes to the file.  
withPreparedStatement<T>(ecsql: string, cb: (stmt: ECSqlStatement) => T): T Use a prepared ECSQL statement.  

Properties

Name Type Description
isOpen Accessor ReadOnly boolean Returns true if the ECDb is open  

Defined in

Last Updated: 08 January, 2020