ResultMapper

internal class ResultMapper(val catalog: TypeCatalog, localConverters: List<ResultConverter<*, *>>?, types: TypeLookup)

Entry point of the read conversion chain: hands a decoded value to the converters and checks the result.

One of these belongs to each execution, over the TypeCatalog that execution pinned and whatever converters the query registered for itself. It is what Row.get and the fetchObject* family call, and a Row holds on to the one its execution ran under - so a row read long after the query finished still resolves against the catalog the query ran against.

Parameters

catalog

The pinned catalog to resolve converters, dictionaries and registrations against.

localConverters

Converters registered on the query itself, in registration order, or null where it registered none. Consulted ahead of the catalog's.

types

The lookup handed to converters, reading the same pinned catalog.

Constructors

Link copied to clipboard
constructor(catalog: TypeCatalog, localConverters: List<ResultConverter<*, *>>?, types: TypeLookup)

Properties

Link copied to clipboard
internal val catalog: TypeCatalog
Link copied to clipboard

Functions

Link copied to clipboard
fun <T> deserialize(source: Any?, expectedType: KType, sourceType: PgType): T

Converts a decoded database value to expectedType.