title: Insert if not exists in Slick 3.0.0
body: <p>I'm trying to insert if not exists, I found <a href="https://stackoverflow.com/questions/18864351/scalatra-slick-and-insert-if-not-exists">this post</a> for 1.0.1, 2.0.</p>
  
  <p>I found snippet using transactionally in <a href="http://slick.typesafe.com/doc/3.0.0/dbio.html#index-3" rel="noreferrer">the docs of 3.0.0</a></p>
  
  <pre><code>val a = (for {
    ns &lt;- coffees.filter(_.name.startsWith("ESPRESSO")).map(_.name).result
    _ &lt;- DBIO.seq(ns.map(n =&gt; coffees.filter(_.name === n).delete): _*)
  } yield ()).transactionally
  
  val f: Future[Unit] = db.run(a)
  </code></pre>
  
  <p>I'm struggling to write the logic from insert if not exists with this structure. I'm new to Slick and have little experience with Scala. This is my attempt to do insert if not exists outside the transaction...</p>
  
  <pre><code>val result: Future[Boolean] = db.run(products.filter(_.name==="foo").exists.result)
  result.map { exists =&gt;  
    if (!exists) {
      products += Product(
        None,
        productName,
        productPrice
      ) 
    }  
  }
  </code></pre>
  
  <p>But how do I put this in the transactionally block? This is the furthest I can go:</p>
  
  <pre><code>val a = (for {
    exists &lt;- products.filter(_.name==="foo").exists.result
    //???  
  //    _ &lt;- DBIO.seq(ns.map(n =&gt; coffees.filter(_.name === n).delete): _*)
  } yield ()).transactionally
  </code></pre>
  
  <p>Thanks in advance</p>