get

fun <T> get(index: Int, targetType: KType): T

Retrieves the value of the column at the specified index, mapped to the specified targetType.

Return

The mapped column value.

Parameters

index

The zero-based index of the column.

targetType

The Kotlin reflection type representing the desired output type.

Type Parameters

T

The expected type of the returned value.

Throws

if the column cannot be mapped to the requested type.


inline operator fun <T> get(index: Int): T

Retrieves the value of the column at the specified index, mapped to the reified type T.

Also written row[0], where the expected type is what fixes T - val id: Int = row[0].

Return

The mapped column value.

Parameters

index

The zero-based index of the column.

Type Parameters

T

The expected type of the returned value.

Throws

if the column cannot be mapped to the requested type.


fun <T> get(columnName: String, targetType: KType): T

Retrieves the value of the column with the specified columnName, mapped to the specified targetType.

Return

The mapped column value.

Parameters

columnName

The name of the column.

targetType

The Kotlin reflection type representing the desired output type.

Type Parameters

T

The expected type of the returned value.

Throws

if the column is not found or cannot be mapped.


inline operator fun <T> get(columnName: String): T

Retrieves the value of the column with the specified columnName, mapped to the reified type T.

Also written row["cognomen"], where the expected type is what fixes T - and its nullability with it, exactly as in the fetch* family: val name: String = row["cognomen"] refuses a NULL, val name: String? = row["cognomen"] accepts one.

Return

The mapped column value.

Parameters

columnName

The name of the column.

Type Parameters

T

The expected type of the returned value.

Throws

if the column is not found or cannot be mapped.