schemasafe / troy

Type-safe and Schema-safe Scala wrapper for Cassandra driver
Apache License 2.0
151 stars 14 forks source link

Support SELECT "ORDER BY" clause #107

Closed tabdulradi closed 7 years ago

tabdulradi commented 7 years ago

Start with the parser, 99% the rest is already implemented, but an integration test case under troy-macro subproject is necessary to prove it is working end to end.

tabdulradi commented 7 years ago

Example of an integration test

val listByAuthor = withSchema { (authorId: UUID) =>
      cql"""
         SELECT post_id, author_name, reviewer_name, post_title, post_rating, post_tags
         FROM test.posts
         WHERE author_id = $authorId
         ORDER BY post_id DESC ;
       """
        .prepared
        .executeAsync
        .as(Post)
  }