create

fun create(rangeOid: Int, elementOid: Int, lowerBound: Any? = null, upperBound: Any? = null, isLowerInclusive: Boolean = true, isUpperInclusive: Boolean = false, isLowerInfinite: Boolean = (lowerBound == null), isUpperInfinite: Boolean = (upperBound == null), isLowerNull: Boolean = false, isUpperNull: Boolean = false): PgRange

Creates a range, packing the bound descriptions into the protocol's flag byte.

The defaults produce PostgreSQL's own [) convention: lower inclusive, upper exclusive, and a bound left null treated as unbounded rather than as a NULL value. Pass isLowerNull or isUpperNull to mean the other thing. Infinite wins over Null where both are asked for.

Return

The constructed PgRange.

Parameters

rangeOid

OID of the range type.

elementOid

OID of its bound type.

lowerBound

The lower bound value, or null for none.

upperBound

The upper bound value, or null for none.

isLowerInclusive

Whether the lower bound is part of the range.

isUpperInclusive

Whether the upper bound is part of the range.

isLowerInfinite

Whether the range is unbounded below. Defaults to lowerBound == null.

isUpperInfinite

Whether the range is unbounded above. Defaults to upperBound == null.

isLowerNull

Whether the lower bound is present but NULL.

isUpperNull

Whether the upper bound is present but NULL.