Quill v3.9.0 Release Notes

  • Migration Notes:

    ๐Ÿš€ This release modifies Quill's core encoding DSL however this is very much an internal API. If you are using MappedEncoder, which should be the case for most users, you will be completely unaffected. The MappedEncoder signatures remain the same.

    Quill's core encoding API has changed:

    // From:
    type BaseEncoder[T] = (Index, T, PrepareRow) => PrepareRow
    type BaseDecoder[T] = (Index, ResultRow) => T
    // To:
    type BaseEncoder[T] = (Index, T, PrepareRow, Session) => PrepareRow
    type BaseDecoder[T] = (Index, ResultRow, Session) => T
    

    That means that internal signature of all encoders has also changed. For example, the JdbcEncoder has changed:

    // From:
    case class JdbcEncoder[T](sqlType: Int, encoder: BaseEncoder[T]) extends BaseEncoder[T] {
      override def apply(index: Index, value: T, row: PrepareRow) =
        encoder(index + 1, value, row)
    }
    // To:
    case class JdbcEncoder[T](sqlType: Int, encoder: BaseEncoder[T]) extends BaseEncoder[T] {
      override def apply(index: Index, value: T, row: PrepareRow, session: Session) =
        encoder(index + 1, value, row, session)
    }
    

    ๐Ÿ‘€ If you are writing encoders that directly implement BaseEncoder, they will have to be modified with an โž• additional session: Session parameter.

    The actual type that Session is will vary. For JDBC this will be Connection, for Cassandra this will be some implementation of CassandraSession, for other systems that use a entirely different session paradigm this will just be Unit.

    Again, if you are using MappedEncoders for all of your custom encoding needs, you will not be affected by this change.