title: exists query in slick
body: <p>i have query like bellow</p>
  
  <pre><code>  override def isOnList(id: Long, value: String)(implicit ex: ExecutionContext): DBIO[Boolean] = {
      tableQuery.filter(e =&gt; e.id === id &amp;&amp; e.isActive &amp;&amp; e.value === value).exists.result
    }
  </code></pre>
  
  <p>But it returns false when the table does not any rows with id === id. I would like to change this. My modification is</p>
  
  <pre><code>  override def isOnList(id: Long, value: String)(implicit ex: ExecutionContext): DBIO[Boolean] = {
      tableQuery.filter(e =&gt; e.id === id &amp;&amp; e.isActive).result.flatMap {
        case seq if seq.isEmpty =&gt; DBIOAction.successful(true)
        case seq =&gt; DBIOAction.successful(seq.exists(_.value==value))
      }
    }
  </code></pre>
  
  <p>I am new with slick, so i would like to know that is it good solution or not (i coud not find any information.)?
  Oh i forgot, Id is not unique.</p>