title: Slick 3.0 Howto change the return type of a join to a more useful value
body: <p>currently I try to create some Join Queries on slick, however like the nature of the Join it will have the result of Seq(ObjectA1, ObjectB) and if the right hand object has many left hand objects it will look like that:</p>
  
  <pre><code>Seq[
     (ObjectA, Object1),
     (ObjectA, Object2),
     (ObjectA, Object3),
     (ObjectB, Object4),
     (ObjectB, Object5)
  ] 
  </code></pre>
  
  <p>How could I transform these values to have a more flat structure like that:
  <code>Seq[(ObjectA, Seq[Object1, Object2, Object3]), (ObjectB, Seq[Object4, Object5])]</code></p>
  
  <p>Is there any good way to do that?</p>
  
  <p>Oh and here is my Code:</p>
  
  <pre><code>   def testInnerJoin(id: Rep[Long]) = for {
      (td, t) &lt;- termsData joinRight terms on (_.termsId === _.id) if t.id === id
     } yield (t, td)
  
     val compiledJoin = Compiled(testInnerJoin _)
  
     def queryThat = {
  
       db.run(compiledJoin(2L).result)
     }
  </code></pre>
  
  <p>Without knowing what's good or bad I would just do it like that:</p>
  
  <pre><code>db.run(compiledJoin(2L).result).map(data=&gt; data.groupBy(_._1).mapValues(_.map(_._2)))
  </code></pre>
  
  <p>however doesn't look to efficient, since the most computation is running inside scala, so any suggestions?</p>