like method Null safety

QueryExpressionJunction<T, InstanceType> like(
  1. String value,
  2. {bool caseSensitive = true}
)

Adds a like expression to a query.

A query will only return objects where the selected property is like value.

For more documentation on postgres pattern matching, see https://www.postgresql.org/docs/10/functions-matching.html.

This method can be used on String types.

The flag caseSensitive controls whether strings are compared case-sensitively.

Example:

  final query = new Query<User>()
    ..where((u) => u.name ).like("bob");

Implementation

QueryExpressionJunction<T, InstanceType> like(
  String value, {
  bool caseSensitive = true,
}) {
  expression = StringExpression(
    value,
    PredicateStringOperator.equals,
    caseSensitive: caseSensitive,
  );

  return _createJunction();
}