SpiRow
Namespace: Ankus
Assembly: Ankus.Runtime.dll
Contains a managed copy of one SPI result row, independent of PostgreSQL memory contexts.
public sealed class SpiRowInheritance: object
Properties
Section titled “Properties”Gets the number of cells in this row.
public int Count { get; }Value: int
this[int]
Section titled “this[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.
this[string]
Section titled “this[string]”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.
Methods
Section titled “Methods”GetOrdinal(string)
Section titled “GetOrdinal(string)”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.
GetTypeOid(int)
Section titled “GetTypeOid(int)”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.
GetTypeOid(string)
Section titled “GetTypeOid(string)”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.
Get<T>(int)
Section titled “Get<T>(int)”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.
Get<T>(string)
Section titled “Get<T>(string)”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.
Set<T>(int, T)
Section titled “Set<T>(int, T)”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.
Set<T>(string, T)
Section titled “Set<T>(string, T)”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.