title: Case-Insensitive String Comparison in Slick?
body: <p>What is the proper way of finding the one User matching username?</p>
  
  <p>With user-defined type User:</p>
  
  <pre><code>case class User (userId: String, username: String)
  
  object User extends Table[User]("user") {
    def userId = column[String]("userId", O.PrimaryKey)
    def username = column[String]("username")
    def * = userId ~ authId ~ username &lt;&gt;(User.apply _, User.unapply _)
  
    Database.forDataSource(DB.getDataSource()) withSession {
      implicit session: Session =&gt;
  
      val q = for { u &lt;- User if u.username.equalsIgnoreCase(someUsername) }
        yield u
      q.headOption
  </code></pre>
  
  <p>user.username is of type Column[String] which has no conversion to String.</p>
  
  <p>What is desired is to have the Database do the string-insensitive comparison as part of the query.</p>