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, options?: PageOptions): AsyncIterableIterator<any> Execute a pageable query.  
queryPage(ecsql: string, bindings?: any[] | object, options?: PageOptions): Promise<any[]> Execute a query agaisnt this ECDb
The result of the query is returned as an array of JavaScript objects where every array element represents an
ECSQL row.
 
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: 13 May, 2019