Quill v3.9.0 Release Notes
-
- Pass Session to all Encoders/Decoders allowing UDT Encoding without local session varaible in contexts e.g. ZIO and others
- Fixing on-conflict case with querySchema/schemaMeta renamed columns
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 โ additionalsession: Session
parameter.The actual type that
Session
is will vary. For JDBC this will beConnection
, forCassandra
this will be some implementation ofCassandraSession
, for other systems that use a entirely different session paradigm this will just beUnit
.Again, if you are using MappedEncoders for all of your custom encoding needs, you will not be affected by this change.