title: Updating some fields implicitly when update in Slick?
body: <p>I am using Slick 3.2 in my Scala application.</p>
  
  <p>In my application, all the tables have <code>created_at</code> and <code>updated_at</code> as their fields.
  For example the <code>users</code> table have <code>created_at</code> and <code>updated_at</code>.</p>
  
  <p>I want to update <code>updated_at</code> implicitly when I update these tables through Slick implementing an extension method.</p>
  
  <p>Is there a way to implement such method?</p>
  
  <pre class="lang-scala prettyprint-override"><code>package com.example
  
  object Main {
    import slick.jdbc.MySQLProfile.api._
    import java.time.Instant
    import slick.jdbc.JdbcType
    import java.sql.Timestamp
  
    implicit val instantColumnType: JdbcType[Instant] with BaseTypedType[Instant] = ??? // definition is omitted.
  
    case class User(id: Int, name: String, mail: String, createdAt: Instant, updatedAt: Instant)
  
    abstract class AppTable[T](tag: Tag, tableName: String) extends Table[T](tag, tableName) {
      def createdAt = column[Instant]("created_at")
      def updatedAt = column[Instant]("updated_at")
    }
  
    class UserTable(tag: Tag) extends AppTable[User](tag, "users") {
      def id = column[Int]("id", O.PrimaryKey, O.AutoInc)
      def name = column[String]("name")
      def mail = column[String]("mail")
  
      def * = (id, name, mail, createdAt, updatedAt) &lt;&gt; ((User.apply _).tupled, User.unapply)
    }
  
    val users: TableQuery[UserTable] = ??? // instantiation of users is omitted.
  
    def main(args: Array[String]): Unit = {
      // This needs to execute SQL like
      // UPDATE users SET name = 'foo', mail = 'bar@example.com', updated_at = '2019-06-02T02:27:43'
      users
        .filter(record =&gt; record.id === 42)
        .updateExtra(
          record =&gt; (record.name, record.mail),
          ("foo", "bar@example.com"),
        )
    }
  }
  </code></pre>