CodecDictionary

A dictionary that maps PostgreSQL OIDs and Kotlin classes to their corresponding TypeCodecs.

Provides methods for looking up codecs for parameters and results mapping, as well as registering custom codecs. Instances are immutable.

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard

Functions

Link copied to clipboard
internal fun buildUpdated(newTypes: Map<Int, PgType>, registry: TypeRegistry): CodecDictionary

Rebuilds the dictionary with new dynamically resolved types from the database.

Link copied to clipboard
fun <T : Any> getCodecByClass(kClass: KClass<T>): TypeCodec<T>?

Retrieves a default TypeCodec for the given Kotlin class.

Link copied to clipboard
fun <T : Any> getCodecByOid(oid: Int): TypeCodec<T>?

Retrieves a TypeCodec suitable for the given PostgreSQL OID.

Link copied to clipboard
fun getOidForCodec(codec: TypeCodec<*>): Int?

Retrieves the mapped OID for a specific TypeCodec.

Link copied to clipboard
internal fun withRegisteredCodec(codec: TypeCodec<*>, dictionary: TypeDictionary): CodecDictionary

Creates a new CodecDictionary by registering an additional TypeCodec.