Skip to content

SpiRow

Namespace: Ankus

Assembly: Ankus.Runtime.dll

Contains a managed copy of one SPI result row, independent of PostgreSQL memory contexts.

public sealed class SpiRow

Inheritance: object

Gets the number of cells in this row.

public int Count { get; }

Value: int

Gets a cell by its zero-based column ordinal. SQL NULL is represented by null. A cell whose type has no managed conversion throws; read it with its PgDatumTypeAttribute type.

public object? this[int ordinal] { get; }

Parameters:

ordinal — int

The zero-based column ordinal.

Value: object

The managed cell.

Gets a cell by its exact, case-sensitive column name. Duplicate names resolve to the first column.

public object? this[string name] { get; }

Parameters:

name — string

The column name.

Value: object

The managed cell or null for SQL NULL.

Resolves an exact, case-sensitive column name to its zero-based ordinal. Duplicate names resolve to the first column.

public int GetOrdinal(string name)

Parameters:

name — string

The column name.

Returns: int

The zero-based ordinal.

Gets a cell’s PostgreSQL type OID, including its original domain OID until replaced by Set.

public uint GetTypeOid(int ordinal)

Parameters:

ordinal — int

The zero-based column ordinal.

Returns: uint

The cell’s current type OID.

Gets a cell’s current PostgreSQL type OID by exact column name.

public uint GetTypeOid(string name)

Parameters:

name — string

The column name.

Returns: uint

The cell’s current type OID.

Gets a typed cell without implicit numeric or textual conversion. Temporal cells also accept exact .NET conversions. SQL NULL is accepted for nullable value types and reference types. A PgDatumTypeAttribute type, or an array of one, uses its reader when the cell has exactly the mapped PostgreSQL type. PgDatum rebuilds the cell, including SQL NULL, as a datum of its type owned by the current callback. Reading PgRelation or its arrays opens fresh references that the caller must dispose.

public T Get<T>(int ordinal)

Type parameters:

T

The expected managed type.

Parameters:

ordinal — int

The zero-based column ordinal.

Returns: T

The cell value.

Gets a typed cell by an exact, case-sensitive column name. Duplicate names resolve to the first column.

public T Get<T>(string name)

Type parameters:

T

The expected managed type.

Parameters:

name — string

The column name.

Returns: T

The cell value.

Replaces a local cell and its type with a supported managed datum. The edit does not update PostgreSQL or result metadata. Raw datums and PgDatumTypeAttribute values are copied into independent managed storage before assignment; relations retain only their OIDs.

public void Set<T>(int ordinal, T value)

Type parameters:

T

The replacement type, including its type when the value is null.

Parameters:

ordinal — int

The zero-based column ordinal.

value — T

The replacement value.

Replaces a local cell by exact name. Raw datums retain their PostgreSQL type identity and are copied into managed storage.

public void Set<T>(string name, T value)

Type parameters:

T

The replacement managed type.

Parameters:

name — string

The column name; duplicate names resolve to the first column.

value — T

The replacement value.