using Npgsql.Internal.Postgres;
namespace Npgsql.PostgresTypes;
///
/// Represents a PostgreSQL range data type.
///
///
/// See https://www.postgresql.org/docs/current/static/rangetypes.html.
///
public class PostgresRangeType : PostgresType
{
///
/// The PostgreSQL data type of the subtype of this range.
///
public PostgresType Subtype { get; }
///
/// The PostgreSQL data type of the multirange of this range.
///
public PostgresMultirangeType? Multirange { get; internal set; }
///
/// Constructs a representation of a PostgreSQL range data type.
///
protected internal PostgresRangeType(
string ns, string name, uint oid, PostgresType subtypePostgresType)
: base(ns, name, oid)
{
Subtype = subtypePostgresType;
Subtype.Range = this;
}
///
/// Constructs a representation of a PostgreSQL range data type.
///
internal PostgresRangeType(DataTypeName dataTypeName, Oid oid, PostgresType subtypePostgresType)
: base(dataTypeName, oid)
{
Subtype = subtypePostgresType;
Subtype.Range = this;
}
}