TypeDictionary

A dictionary that holds PostgreSQL types definitions and allows querying them by OID or name.

It provides specialized methods to fetch specific type categories such as arrays, ranges, and multiranges. Instances of this class are immutable and intended to be replaced entirely when types are reloaded.

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard
val size: Int

How many types this dictionary holds.

Functions

Link copied to clipboard

Returns the row type of the relation with the given relationOid, or null when this dictionary holds none for it.

Link copied to clipboard
fun forEachType(action: (Int, PgType) -> Unit)

Executes the given action on each registered type.

Link copied to clipboard
fun getArrayType(elementOid: Int): PgType.Array

Retrieves an array type by the OID of its elements.

Link copied to clipboard

Retrieves a multirange type by the OID of its base range type.

Link copied to clipboard
fun getPgType(oid: Int): PgType

Retrieves a PostgreSQL type by its OID.

Link copied to clipboard
fun getRangeType(elementOid: Int): PgType.Range

Retrieves a range type by the OID of its elements.

Link copied to clipboard
internal fun resolveOid(typeName: String, requestedSchema: String, isArray: Boolean = false, searchPath: List<String>): Int

Resolves the OID of a type given its name and an optional schema.