TableQueryBuilder
Table query builder that works with database tables
Constructors
new TableQueryBuilder()
new TableQueryBuilder(
dart
):TableQueryBuilder
Parameters
Parameter | Type |
---|---|
dart | any |
Returns
Constructs
TableQueryBuilder
Source
Properties
Property | Type |
---|---|
dart | any |
Methods
build()
build():
TableQuery
Builds a query
Returns
Source
groupBy()
groupBy(
fields
):TableQueryBuilder
Groups rows that have the same values into summary values
Parameters
Parameter | Type | Description |
---|---|---|
fields | string [] | Array of fields to group by |
Returns
Source
limit()
limit(
n
):TableQueryBuilder
Selects limited number of records
Parameters
Parameter | Type | Description |
---|---|---|
n | number | Number of records to select |
Returns
Source
pivotOn()
pivotOn(
fields
):TableQueryBuilder
Rotates a table-valued expression by turning the unique values from one column in the expression into multiple columns in the output
Parameters
Parameter | Type | Description |
---|---|---|
fields | string [] | Array of fields to pivot on |
Returns
Source
select()
select(
fields
):TableQueryBuilder
Selects specified fields of the table
Parameters
Parameter | Type | Description |
---|---|---|
fields | string [] | Array of fields to select |
Returns
Source
selectAll()
selectAll():
TableQueryBuilder
Selects all fields of the table
Returns
Source
sortBy()
sortBy(
field
,asc
):TableQueryBuilder
Sorts results in ascending or descending order
Parameters
Parameter | Type | Default value | Description |
---|---|---|---|
field | string | undefined | Field to sort based on |
asc | boolean | true | Sort in ascending order |
Returns
Source
where()
where(
field
,pattern
):TableQueryBuilder
Adds a where clause to the query
Parameters
Parameter | Type | Description |
---|---|---|
field | string | Field name |
pattern | string | Pattern to test field values against |
Returns
Source
from()
static
from(table
):TableQueryBuilder
Creates TableQueryBuilder from table name
Parameters
Parameter | Type | Description |
---|---|---|
table | string | Table name |
Returns
Source
fromTable()
static
fromTable(table
):TableQueryBuilder
Creates TableQueryBuilder from TableInfo
Parameters
Parameter | Type | Description |
---|---|---|
table | TableInfo | TableInfo object |