Skip to content

Version 2.12.0

Choose a tag to compare

@CaesarAugustus27 CaesarAugustus27 released this 19 Nov 17:28
· 66 commits to master since this release

Project

Changed

  • Dependencies move to their current releases: kotlinx.serialization 1.13.0, Spring Boot 4.1.2 in
    driver-spring-integration, ClassGraph 4.8.200, kotlin-logging 8.0.7 and SLF4J 2.0.20.

Driver

Changed

  • [BREAKING] A parameter of a class that no converter claims and no codec encodes, such as an unregistered data
    class or a Map, fails with MappingException(NO_CONVERTER_FOUND) naming the class, as it already did as a
    composite attribute.

  • [BREAKING] A side of a range is infinite exactly where its bound is null. Range, rangeOf,
    PgRange.create and ContainerFactory.createRange no longer take isLowerInfinite and isUpperInfinite, which
    Range still has as properties, and isLowerNull and isUpperNull are gone.

  • isLowerInclusive defaults to whether there is a lower bound, so rangeOf(upperBound = 10) is (,10) and reads
    back equal to itself. It defaulted to true, which the server drops from an infinite side.

  • [BREAKING] A digit stays in the word it follows wherever a name is converted to snake_case, so b2bCustomer
    maps to b2b_customer, where it was b2_b_customer. Only a name with a lowercase letter right after a digit maps
    differently; one mapped to the old form needs @PgName or a renamed column.

Fixed

  • A row or a composite read as a Map whose key type is not String or Any fails with
    MappingException(CONVERSION_ERROR). It came back keyed by its names anyway, so the caller got a
    ClassCastException at the first key read.

  • withPgType(PgStandardType) names its type in pg_catalog, so a type of the same name earlier on the search path
    is no longer sent in its place.

  • A Range or MultiRange sent as a type that is not a range or a multirange fails with
    MappingException(CONVERSION_ERROR) caused by TypeException(NOT_A_CONTAINER), where the cause was
    TYPE_NOT_FOUND.

  • A parameter converter that returns a value its codec cannot take fails with MappingException(CONVERSION_ERROR)
    naming the converter and the class it returned.

Client

Changed

  • [BREAKING] DynamicWriteStrategy is gone, with dynamicWriteStrategy on fromDataSource and
    fromSessionProvider and DynamicTypes.strategy. A registered class is written as a dynamic_dto without
    wrapping, as under the default mode; EXPLICIT_ONLY refused that write.

  • [BREAKING] A class registered both as a composite and as a dynamic type fails with
    MappingException(CONVERSION_ERROR) where nothing declares which of the two it goes in as. Under the default mode
    it went in as the composite, which a dynamic_dto column refused. withPgType chooses.

  • [BREAKING] DynamicTypes.toDynamicDto is gone. withPgType("dynamic_dto", "public") sends a value as a
    dynamic_dto, and another Json goes in through
    registerParameterConverter(db.dynamicTypes.parameterConverter(json)).

  • [BREAKING] A dynamic_dto payload is keyed as the driver names columns, in snake_case or by @PgName: the
    default dynamicJson is octaviusSnakeCaseJson, where it was octaviusJson.

pg-model

Added

  • octaviusSnakeCaseJson: octaviusJson with each key named as the driver names a column, by @PgName or in
    snake_case. @PgName is a @SerialInfo annotation, so a naming strategy of one's own can read it too.

  • LocalTimeWithEndOfDaySerializer, in octaviusSerializersModule: a @Contextual LocalTime that is
    LocalTime.MAX goes into JSON as 24:00:00, the end of the day a time column holds, and 24:00:00 reads back.