Skip to content

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?>, IEnumerable

Inheritance: object

Implements: IReadOnlyList<PgAnyElement>, IReadOnlyCollection<PgAnyElement>, IEnumerable<PgAnyElement>, IEnumerable

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.

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.

Enumerates nullable cells in PostgreSQL row-major order.

public IEnumerator<PgAnyElement?> GetEnumerator()

Returns: IEnumerator<PgAnyElement>

The checked cell iterator.

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.

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.

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.

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

Gets the declared array element type OID, including domains and unregistered enum types.

public uint ElementTypeOid { get; }

Value: uint

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

Gets the actual array type OID, including a domain over an array.

public uint TypeOid { get; }

Value: uint