On Wednesday, November 14, 2012 9:06:13 AM UTC-5, Ryan Bair wrote:
> Columns have methods desc and asc on them which return an Ordering. Rather
> than just returning _._2 from the case you could return _._2.desc instead.
> You should not need the type parameter if you do that.
> On Wed, Nov 14, 2012 at 4:13 AM, Pradeep Kumar Mishra <pkmi...@gmail.com<javascript:>
> > wrote:
>> FYI getting following error if I do not specify any type in sortBy
>> No implicit view available from scala.slick.lifted.Column[_ >:
>> Option[String] with Double with String] => scala.slick.lifted.Ordered.
>> On Wednesday, November 14, 2012 4:09:30 AM UTC-5, Pradeep Kumar Mishra
>> wrote:
>>> This is with reference to thread - https://groups.google.com/**
>>> forum/#!searchin/scalaquery/**sort/scalaquery/8K1dLmoIh0A/**brwESE1eDlIJ<https://groups.google.com/forum/#!searchin/scalaquery/sort/scalaquery...>
>>> What's the current best way to go for dynamic sorting. I am using
>>> following query
>>> val q2 = q1.sortBy[scala.slick.lifted.**Column[Option[String]]](**queryParams.sortTe rm
>>> match {
>>> case "itemSKU" => _._2
>>> case "price" => _._3
>>> case _ => _._1
>>> })
>>> But since I need to specify type (in red) the returning column type can
>>> not be dynamic. Looks like I am doing something wrong here.
>> --