parse method

Query parse (
  1. String source,
  2. {Sorter sorter,
  3. int skip: 0,
  4. int take,
  5. Schema schema}
)

Parses a search query using SearchQueryParser.

The only required parameter is the search query. Other parameters are optional. For a description of the other parameters, see Query.

import 'package:database/database.dart';

final query = Query.parse(
  'Coffee Mug price:<=10',
  sorter: PropertySorter.descending('price'),
  skip: 0,
  take: 10,
);

Implementation

static Query parse(
  String source, {
  Sorter sorter,
  int skip = 0,
  int take,
  Schema schema,
}) {
  final filter = SearchQueryParser().parseFilterFromString(source);
  return Query(
    filter: filter,
    sorter: sorter,
    skip: skip,
    take: take,
    schema: schema,
  );
}