ColumnMetadata

class ColumnMetadata(val name: String, val type: PgType, val typeModifier: Int, val origin: ColumnOrigin?)

What the server said about one column of a result, resolved against the type catalog the query ran under.

Built once per RowDescription - once per result rather than once per row - and shared by every Row read from it.

Constructors

Link copied to clipboard
internal constructor(name: String, type: PgType, typeModifier: Int, origin: ColumnOrigin?)

Properties

Link copied to clipboard

The name the column came back under: the alias where the query gave it one, the source column's name where it did not.

Link copied to clipboard
val oid: Int

The OID of the column's type.

Link copied to clipboard

Where the column was read from, when it is a plain reference to a column of a relation, and null when it is not: an expression, a literal, the output of a function.

Link copied to clipboard

The column's type. Resolved through the dictionary in force when the query ran, so two columns of one result always agree on the catalog they were read against. Never a PgType.Domain: the server resolves a domain to the type underneath it before describing a column - for a plain reference, an explicit cast and a function's result alike - so a column declared over one arrives as the base type, and only origin still says which column it was. A domain is still reachable through a type, as an array's element or a composite's attribute, where it survives.

Link copied to clipboard

The server's raw atttypmod for the column, -1 where the type takes no modifier. It is the one thing here with no other source - the precision and scale of a numeric(10,2), the length of a varchar(64), the precision of a timestamp(3) live nowhere else in a result - and it is left undecoded because reading it takes knowledge of the particular type.