title: How to return Future of Either[Throwable,Int] from a Scala Slick Query output
body: <p>I am a beginner in scala , I am using <code>slick</code> and <code>postgres</code> for one of my <code>model API</code>
  Below is my function that takes <code>Id: String</code> as input and forms a <code>left inner join query</code> which returns <code>matching Ids(String) from DB table</code>.</p>
  <pre><code>def getCountByID(
      Id: String
    ): Future[Either[Throwable, Int]] = {
      val innerJoin = for {
        (rel,a) &lt;- executors joinLeft executors on ( (e1, e2) =&gt; {
      e1.column1 === e2.column1 &amp;&amp; e1.column2 === e2.column2
      } ) if rel.id === Id
    } yield a.map(_.id)
  
    db.run(innerJoin.result) # Seq of options =&gt; FixedSqlStreamingAction[Seq[Option[String]],Option[String],dbio.Effect.Read]
  
    }
  </code></pre>
  <p>The <code>db.run</code> gives me a  <code>Seq of options</code> . I want to return a <code>Future</code> with <code>Either</code> <code>length</code> of <code>Ids</code> or some <code>throwable exception</code> . How can I achieve the same here.</p>