{}
queryExecute
options.get
method is the most common method used for retrieving results. It executes using the configured QueryBuilder
and returns the results.get
can also take a list or array of columns to use as a shortcut. If any are passed, those columns will be used instead of any columns previously set on the QueryBuilder
.false
{}
queryExecute
options.first
method. This method will return a single record (a Struct
by default). If no row is found an empty Struct
will be returned by default.false
{}
queryExecute
options.values
method. The values
method will return the column of your choosing as a simple array.values
:false
{}
queryExecute
options.values
method will return the expression given for each row as a simple array.false
false
false
true
, it throws a RecordCountException
if no records are returned from the query.false
{}
queryExecute
options.values
except it only returns a single, simple value. Where values
calls get
under the hood, this method calls first
.throwWhenNotFound
boolean is set to true
, a RecordCountException
will be thrown. Otherwise the defaultValue
provided to the method will be returned.value
:false
false
false
true
, it throws a RecordCountException
if no records are returned from the query.false
{}
queryExecute
options.value
method will return the expression given for the first row found.{}
queryExecute
options.chunk
can be called on any query like you would call get
. You can stop the retrieving and processing early by returning false
from the callback.false
1
false
25
false
{}
queryExecute
options.count
and forPage
.false
1
false
25
false
{}
queryExecute
options.count
of the number of records the query would return. This can be desirable for performance reasons if your query count is rather large. It instead determines if there are more records by asking for one more row that your specified maxRows
. If the number of rows returned exceeds your specified maxRows
then the pagination returns hasMore: true
. The results
will always contain your specified maxRows
(or less, if there aren't enough records).paginate
method. It can be a struct or a component. It needs one function defined and will be passed the following parameters.paginationCollector
argument or by calling setPaginationCollector
on a query builder instance.cbpaginator
as its pagination collector. The return format of cbpaginator
is the example shown above.simplePaginate
method was added. This uses a new method on the paginationCollector
.paginationCollector
, ensure it has been updated with this new generateSimpleWithResults
method before calling simplePaginate
.