PgAnyArray
Namespace: Ankus
Assembly: Ankus.Runtime.dll
Represents a PostgreSQL anyarray with its actual element type, dimensions, lower bounds, and nullable cells.
public sealed class PgAnyArray : IReadOnlyList<PgAnyElement?>, IReadOnlyCollection<PgAnyElement?>, IEnumerable<PgAnyElement?>, IEnumerableInheritance: object
Implements: IReadOnlyList<PgAnyElement>, IReadOnlyCollection<PgAnyElement>, IEnumerable<PgAnyElement>, IEnumerable
Constructors
Section titled “Constructors”PgAnyArray(PgDatum)
Section titled “PgAnyArray(PgDatum)”Reads an array’s shape and cells into the supplied datum’s checked native owner.
public PgAnyArray(PgDatum datum)Parameters:
datum — PgDatum
A present PostgreSQL array value.
Extraction preserves existing domain values without reapplying their constraints.
Methods
Section titled “Methods”CopyTo(PgMemoryContext)
Section titled “CopyTo(PgMemoryContext)”Copies the complete array into an independent native owner.
public PgAnyArray CopyTo(PgMemoryContext context)Parameters:
context — PgMemoryContext
The destination context.
Returns: PgAnyArray
The independently owned array.
GetEnumerator()
Section titled “GetEnumerator()”Enumerates nullable cells in PostgreSQL row-major order.
public IEnumerator<PgAnyElement?> GetEnumerator()Returns: IEnumerator<PgAnyElement>
The checked cell iterator.
GetLength(int)
Section titled “GetLength(int)”Gets the length of a zero-based dimension.
public int GetLength(int dimension)Parameters:
dimension — int
The zero-based dimension.
Returns: int
The dimension length.
GetLowerBound(int)
Section titled “GetLowerBound(int)”Gets the PostgreSQL lower bound of a zero-based dimension.
public int GetLowerBound(int dimension)Parameters:
dimension — int
The zero-based dimension.
Returns: int
The actual lower bound.
Read<T>()
Section titled “Read<T>()”Reads a managed array with exact type checking; polymorphic wrappers retain this array’s native lifetime.
public T Read<T>()Type parameters:
T
The requested array representation.
Returns: T
The managed array copy or checked polymorphic wrapper.
Properties
Section titled “Properties”Gets the total number of cells in row-major order.
public int Count { get; }Value: int
Gets the array’s native value and actual PostgreSQL type.
public PgDatum Datum { get; }Value: PgDatum
ElementTypeOid
Section titled “ElementTypeOid”Gets the declared array element type OID, including domains and unregistered enum types.
public uint ElementTypeOid { get; }Value: uint
this[int]
Section titled “this[int]”Gets a checked cell by its zero-based flattened ordinal, or null for SQL NULL.
public PgAnyElement? this[int index] { get; }Parameters:
index — int
The flattened ordinal.
Value: PgAnyElement
Gets the number of dimensions; an empty PostgreSQL array has zero dimensions.
public int Rank { get; }Value: int
TypeOid
Section titled “TypeOid”Gets the actual array type OID, including a domain over an array.
public uint TypeOid { get; }Value: uint