title: Passing result of one DBIO into another
body: <p>I'm new to Slick and I am trying to rewrite the following two queries to work in one transaction. My goal is to
   1. check if elements exists
   2. return existing element or create it handling autoincrement from MySQL</p>
  
  <p>The two functions are:</p>
  
  <pre><code>  def createEmail(email: String): DBIO[Email]  = {
      // We create a projection of just the email column, since we're not inserting a value for the id column
      (emails.map(p =&gt; p.email)
        returning emails.map(_.id)
        into ((email, id) =&gt; Email(id, email))
        ) += email
    }
  
    def findEmail(email: String): DBIO[Option[Email]] =
      emails.filter(_.email === email).result.headOption
  </code></pre>
  
  <p>How can I safely chain them, ie. to run first check for existence, return if object already exists and if it does not exist then create it and return the new element in one transaction?</p>