title: Slick Plain SQL Query with Dynamic Conditions
body: <p>I'm struggling on appending additional conditions to my query. In its simplest form, what I need is something like below:</p>
  
  <pre><code>def findPeople(name: String, maybeSurname: Option[String]) = {
     val sql1 = sql"select * from my_table where name = $name"
     val sql2 = maybeSurname.map( surname =&gt; sql"and col2 = $surname" ).getOrElse(sql"")
     val finalSql = sql1 + sql2 // I need this kind of feature
     ...
     ...
  }
  </code></pre>
  
  <p>Using <a href="http://slick.typesafe.com/doc/3.0.2/sql.html#splicing-literal-values" rel="noreferrer">#$</a> could be an option, but then surname wouldn't be a bind variable, which is a big issue.</p>