order method

  1. @override
QueryMethod<T?> order(
  1. List<String> columns,
  2. String type
)
override

The order command is used to sort the data returned in ascending order. SELECT * FROM tasks ORDER BY name ASC;

Implementation

@override
QueryMethod<T?> order(List<String> columns, String type) {
  type = [null, ''].contains(type) ? 'ASC' : type;
  return this
    .._order.addAll(columns
        .map((item) => item.split(' ').length > 1 ? item : '$item $type'));
}