The 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
.
If you just need to retrieve a single row from the database table, you may use the 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.
throws: EntityNotFound
Returns the first matching row for the configured query, just like first
. If no records are found, it throws an EntityNotFound
exception.
If you don't even need an entire row, you may extract a single value from each record using the values
method. The values
method will return the column of your choosing as a simple array.
An expression can also be passed to values
:
The valuesRaw
function can make this pattern more ergonomic.
The values
method will return the expression given for each row as a simple array.
This method is similar to values
except it only returns a single, simple value. Where values
calls