registerAutoComposite

inline fun <T : Any> registerAutoComposite(typeName: String = "", schema: String = "")

Registers a composite type mapped reflectively onto the data class T.

Property names are matched to attribute names by converting camelCase to snake_case; PgName overrides that per property.

Parameters

typeName

Optional custom type name in the database. If empty, the name is derived from the class name by converting PascalCase to snake_case.

schema

Optional schema where the type is defined. If empty, the type is resolved through the search path.

Type Parameters

T

The Kotlin data class representing the composite type.

Throws

if T is not a data class, if the type name is registered for another class, or if T is registered under another type name.


fun registerAutoComposite(kClass: KClass<*>, typeName: String = "", schema: String = "")

Registers a composite type mapped reflectively onto the data class kClass.

A type name is registered for one class and a class under one type name; the same class under the same name again changes nothing.

Parameters

kClass

The Kotlin data class representing the composite type.

typeName

Optional custom type name in the database. If empty, the name is derived from the class name by converting PascalCase to snake_case.

schema

Optional schema where the type is defined. If empty, the type is resolved through the search path.

Throws

if kClass is not a data class, if the type name is registered for another class, or if kClass is registered under another type name.