DbQuery
DbQuery TypeScript Class Reference
Overview
The DbQuery class provides methods to execute data queries against the local (on-device) database. This is the preferred approach to work with local relational data. It is used to DbQuery to select, insert, update and delete business objects.
There are no properties
▶️ fields(fields: Array<string>): DbQuery<T>
fields method sets the list of the fields to be returned by the executeSelect method of DbQuery. It provides functionality similar to the SELECT clause in a sql statement.
▶️ filter(filterExpression: string): DbQuery<T>
Allows the developer to define a filter to be applied, when using executeSelect() method. The filter expects the same syntax as WHERE clause in sql statement.
limit(maxRecords: number): DbQuery<T>
Allows the developer to limit the number of the records returned by the query.
page(index: number): DbQuery<T>
Allows the developer to define the page number to be returned in page indexing scenarios. This make sense only if the limit() method was used.
group(groupExpression: string): DbQuery<T>
Allows the developer to define a query group expression to be used. This is the same as in the GROUP BY clause in Sql
aggregate(aggregateExpression: string): DbQuery<T>
Allows the developer to define a aggregate expression to be used. This is the same as in aggregates(max, count, min , avg, ...) in Sql Note that the aggregate() method can NOT be used together with fields() method - e.g. the developer must either fields() or aggregate() methods
sort(sortExpression: string): DbQuery<T>
Allows the developer to define a sort expression to be used. This is the same as in ORDER BY clause in Sql
executeSelect(): Promise<BusinessObjectBase:T>
executeSelect method performs the actual query execution and returns array of objects, which extends class BusinessObjectBase.
Last updated