get method

  1. @override
Future<List<$ActiveDataclass>> get({
  1. bool distinct = false,
  2. int? limit,
  3. int? offset,
})
override

Executes the statement and returns all rows as a list.

Use limit and offset to limit the number of rows returned An offset will only be applied if a limit is also set

The distinct parameter (disabled by default) controls whether to generate a SELECT DISTINCT query, removing duplicates from the result.

Implementation

@override
Future<List<$ActiveDataclass>> get(
    {bool distinct = false, int? limit, int? offset}) async {
  return $state.db.transaction(() async {
    /// Fetch the items from the database with the prefetch hooks applied
    var items = await $state.prefetchHooks
        .withJoins($state)
        .copyWith(distinct: distinct, limit: limit, offset: offset)
        .buildSelectStatement()
        .get();

    /// Apply the prefetch hooks to the items
    items = await $state.prefetchHooks.addPrefetchedData(items);
    return $state.toActiveDataclass(items);
  });
}