Jaguar-dart / jaguar_orm

Source-generated ORM with relations (one-to-one, one-to-many, many-to-many), preloading, cascading, polymorphic relations, etc
https://jaguar-dart.github.io
BSD 3-Clause "New" or "Revised" License
217 stars 52 forks source link

Order by default direction is confusing #135

Closed JamesMcIntosh closed 5 years ago

JamesMcIntosh commented 5 years ago

The default sort order is ascending = false which is opposite to how all database implement Order By. Can I recommend changing to ascending = true

  Find orderBy(String column, [bool ascending = false]) {
    _orderBy.add(OrderBy(column, ascending));
    return this;
  }

  Find orderByMany(List<String> columns, [bool ascending = false]) {
    columns.forEach((String column) {
      _orderBy.add(OrderBy(column, ascending));
    });
    return this;
  }
tejainece commented 5 years ago

@JamesMcIntosh That would be a breaking change.

JamesMcIntosh commented 5 years ago

@tejainece Yes, I would recommend doing it when you do the next major version release.

tejainece commented 5 years ago

Fixed in 4.x.x