get<TModel extends SqliteModel> method

  1. @override
Future<List<TModel>> get<TModel extends SqliteModel>({
  1. Query? query,
  2. ModelRepository<SqliteModel>? repository,

Fetch one time from the SQLite database Available query providerArgs:

  • collate - a SQL COLLATE clause
  • groupBy - a SQL GROUP BY clause
  • having - a SQL HAVING clause
  • offset - a SQL OFFSET clause
  • orderBy - a SQL ORDER BY clause

Use field names not column names. For example, given a final DateTime createdAt; field: providerArgs: { 'orderBy': 'createdAt ASC' }. If the column cannot be found for the first value before a space, the value is left unchanged.

In a more complex query using multiple tables and lookups like createdAt ASC, name ASC to produce SELECT * FROM "TableName" ORDER BY created_at ASC, name ASC;, providerArgs would equal 'providerArgs': { 'orderBy': 'created_at ASC, name ASC' } with column names defined. As Brick manages column names, this is not recommended and should be written only when necessary.


Future<List<TModel>> get<TModel extends SqliteModel>({
}) async {
  final sqlQuery = QuerySqlTransformer<TModel>(
    modelDictionary: modelDictionary,
    query: query,
  return await rawGet<TModel>(
    repository: repository,