PgIntervalAsDurationConverter

object PgIntervalAsDurationConverter : ResultConverter<PgInterval, Duration>

interval czytany jako Duration.

Sterownik oddaje interval jako PgInterval - miesiące, dni i czas osobno, bo tyle właśnie trzyma PostgreSQL i tylko tak da się to oddać bez zgadywania długości miesiąca. Report engine (IntervalColumn, IntervalFilter) mówi jednak Duration, więc konwerter spłaszcza go po regule justify_interval: miesiąc to 30 dni, dzień to 24 godziny.

Properties

Link copied to clipboard
open override val supportedSourceClass: KClass<PgInterval>

Functions

Link copied to clipboard
open override fun canConvert(sourceClass: KClass<*>, expectedType: KType, sourceType: PgType, context: DeserializationContext): Boolean
Link copied to clipboard
open override fun convert(source: PgInterval, expectedType: KType, sourceType: PgType, context: DeserializationContext): Duration