RowMetadata

class RowMetadata(fields: List<FieldDescription>, dictionary: TypeDictionary)

The shape of a result: one ColumnMetadata per column, in the order the server returned them.

It is built once for a result, from the RowDescription that opens it, and every Row of that result shares it. Resolving the columns there rather than on demand is what keeps a result internally consistent: a reloadTypes() between two reads of the same result cannot leave two of its columns describing themselves against different catalogs.

A column whose type the dictionary does not describe fails at that point, with TypeException. Such a column could never have been decoded anyway - a type the catalog load did not see has no codec either - and failing on the description rather than on the first row that happens to carry a value makes it fail the same way every time.

Constructors

Link copied to clipboard
internal constructor(fields: List<FieldDescription>, dictionary: TypeDictionary)

Properties

Link copied to clipboard

A list of all column names in the order they were returned.

Link copied to clipboard

The metadata of every column, in the order the server returned them.

Link copied to clipboard
val size: Int

The total number of columns in the row.

Functions

Link copied to clipboard

Retrieves the metadata of the column at the specified index.

fun getColumn(columnName: String): ColumnMetadata

Retrieves the metadata of the column with the specified columnName.

Link copied to clipboard
fun getColumnIndex(columnName: String): Int

Finds the zero-based index of the column with the specified columnName.

Link copied to clipboard
fun getOid(index: Int): Int

Retrieves the PostgreSQL Object Identifier (OID) for the type of the column at the specified index.

Link copied to clipboard
fun hasColumn(columnName: String): Boolean

Whether this result has a column called columnName.