async_postgres/pg_types/accessors

Search:
Group by:

Procs

proc `$`(cr: CommandResult): string {.inline, ...raises: [], tags: [], forbids: [].}
proc `==`(cr: CommandResult; s: string): bool {.inline, ...raises: [], tags: [],
    forbids: [].}
proc `[]`(row: Row; col: int): Option[seq[byte]] {....raises: [PgTypeError],
    tags: [], forbids: [].}
Backward-compatible cell access. Returns a copy of the cell data.
proc affectedRows(cr: CommandResult): int64 {.inline, ...raises: [], tags: [],
    forbids: [].}
Extract the number of affected rows from the command result.
proc cellInfo(row: Row; col: int): tuple[off: int, len: int] {.inline,
    ...raises: [PgTypeError], tags: [], forbids: [].}
proc columnIndex(fields: seq[FieldDescription]; name: string): int {.
    ...raises: [PgTypeError], tags: [], forbids: [].}
Find the index of a column by name. Raises PgTypeError if not found.
proc columnIndex(row: Row; name: string): int {....raises: [PgTypeError], tags: [],
    forbids: [].}
Find the index of a column by name using a cached name→index table on the row's underlying RowData. The table is built lazily on first access. Raises PgTypeError if the metadata is not available (e.g. the Row was constructed manually) or the column name is not found.
proc columnMap(fields: seq[FieldDescription]): Table[string, int] {....raises: [],
    tags: [], forbids: [].}
Build a name-to-index mapping for all columns.
proc contains(cr: CommandResult; s: string): bool {.inline, ...raises: [],
    tags: [], forbids: [].}
Check if the command tag contains the given string.
proc get(row: Row; col: int; T: typedesc[bool]): bool
proc get(row: Row; col: int; T: typedesc[float32]): float32
proc get(row: Row; col: int; T: typedesc[float64]): float64
proc get(row: Row; col: int; T: typedesc[int16]): int16
Generic typed accessor. Usage: row.get(0, int16)
proc get(row: Row; col: int; T: typedesc[int32]): int32
Generic typed accessor. Usage: row.get(0, int32)
proc get(row: Row; col: int; T: typedesc[int64]): int64
proc get(row: Row; col: int; T: typedesc[JsonNode]): JsonNode
proc get(row: Row; col: int; T: typedesc[PgBit]): PgBit
proc get(row: Row; col: int; T: typedesc[PgBox]): PgBox
proc get(row: Row; col: int; T: typedesc[PgCidr]): PgCidr
proc get(row: Row; col: int; T: typedesc[PgCircle]): PgCircle
proc get(row: Row; col: int; T: typedesc[PgHstore]): PgHstore
proc get(row: Row; col: int; T: typedesc[PgInet]): PgInet
proc get(row: Row; col: int; T: typedesc[PgInterval]): PgInterval
proc get(row: Row; col: int; T: typedesc[PgLine]): PgLine
proc get(row: Row; col: int; T: typedesc[PgLseg]): PgLseg
proc get(row: Row; col: int; T: typedesc[PgMacAddr8]): PgMacAddr8
proc get(row: Row; col: int; T: typedesc[PgMacAddr]): PgMacAddr
proc get(row: Row; col: int; T: typedesc[PgMoney]): PgMoney
proc get(row: Row; col: int; T: typedesc[PgNumeric]): PgNumeric
proc get(row: Row; col: int; T: typedesc[PgPath]): PgPath
proc get(row: Row; col: int; T: typedesc[PgPoint]): PgPoint
proc get(row: Row; col: int; T: typedesc[PgPolygon]): PgPolygon
proc get(row: Row; col: int; T: typedesc[PgTime]): PgTime
proc get(row: Row; col: int; T: typedesc[PgTimeTz]): PgTimeTz
proc get(row: Row; col: int; T: typedesc[PgTsQuery]): PgTsQuery
proc get(row: Row; col: int; T: typedesc[PgTsVector]): PgTsVector
proc get(row: Row; col: int; T: typedesc[PgUuid]): PgUuid
proc get(row: Row; col: int; T: typedesc[PgXml]): PgXml
proc get(row: Row; col: int; T: typedesc[seq[bool]]): seq[bool]
proc get(row: Row; col: int; T: typedesc[seq[byte]]): seq[byte]
proc get(row: Row; col: int; T: typedesc[seq[float32]]): seq[float32]
proc get(row: Row; col: int; T: typedesc[seq[float64]]): seq[float64]
proc get(row: Row; col: int; T: typedesc[seq[int16]]): seq[int16]
proc get(row: Row; col: int; T: typedesc[seq[int32]]): seq[int32]
proc get(row: Row; col: int; T: typedesc[seq[int64]]): seq[int64]
proc get(row: Row; col: int; T: typedesc[seq[JsonNode]]): seq[JsonNode]
proc get(row: Row; col: int; T: typedesc[seq[Option[bool]]]): seq[Option[bool]]
proc get(row: Row; col: int; T: typedesc[seq[Option[float32]]]): seq[
    Option[float32]]
proc get(row: Row; col: int; T: typedesc[seq[Option[float64]]]): seq[
    Option[float64]]
proc get(row: Row; col: int; T: typedesc[seq[Option[int16]]]): seq[Option[int16]]
proc get(row: Row; col: int; T: typedesc[seq[Option[int32]]]): seq[Option[int32]]
proc get(row: Row; col: int; T: typedesc[seq[Option[int64]]]): seq[Option[int64]]
proc get(row: Row; col: int; T: typedesc[seq[Option[string]]]): seq[
    Option[string]]
proc get(row: Row; col: int; T: typedesc[seq[PgBit]]): seq[PgBit]
proc get(row: Row; col: int; T: typedesc[seq[PgBox]]): seq[PgBox]
proc get(row: Row; col: int; T: typedesc[seq[PgCidr]]): seq[PgCidr]
proc get(row: Row; col: int; T: typedesc[seq[PgCircle]]): seq[PgCircle]
proc get(row: Row; col: int; T: typedesc[seq[PgHstore]]): seq[PgHstore]
proc get(row: Row; col: int; T: typedesc[seq[PgInet]]): seq[PgInet]
proc get(row: Row; col: int; T: typedesc[seq[PgInterval]]): seq[PgInterval]
proc get(row: Row; col: int; T: typedesc[seq[PgLine]]): seq[PgLine]
proc get(row: Row; col: int; T: typedesc[seq[PgLseg]]): seq[PgLseg]
proc get(row: Row; col: int; T: typedesc[seq[PgMacAddr8]]): seq[PgMacAddr8]
proc get(row: Row; col: int; T: typedesc[seq[PgMacAddr]]): seq[PgMacAddr]
proc get(row: Row; col: int; T: typedesc[seq[PgMoney]]): seq[PgMoney]
proc get(row: Row; col: int; T: typedesc[seq[PgNumeric]]): seq[PgNumeric]
proc get(row: Row; col: int; T: typedesc[seq[PgPath]]): seq[PgPath]
proc get(row: Row; col: int; T: typedesc[seq[PgPoint]]): seq[PgPoint]
proc get(row: Row; col: int; T: typedesc[seq[PgPolygon]]): seq[PgPolygon]
proc get(row: Row; col: int; T: typedesc[seq[PgTime]]): seq[PgTime]
proc get(row: Row; col: int; T: typedesc[seq[PgTimeTz]]): seq[PgTimeTz]
proc get(row: Row; col: int; T: typedesc[seq[PgTsQuery]]): seq[PgTsQuery]
proc get(row: Row; col: int; T: typedesc[seq[PgTsVector]]): seq[PgTsVector]
proc get(row: Row; col: int; T: typedesc[seq[PgUuid]]): seq[PgUuid]
proc get(row: Row; col: int; T: typedesc[seq[PgXml]]): seq[PgXml]
proc get(row: Row; col: int; T: typedesc[seq[seq[byte]]]): seq[seq[byte]]
proc get(row: Row; col: int; T: typedesc[seq[string]]): seq[string]
proc get(row: Row; col: int; T: typedesc[string]): string
proc get[T](row: Row; name: string; _: typedesc[T]): T
Generic typed accessor by column name. Usage: row.get("id", int32)
proc getArrayND[T](row: Row; col: int): PgArray[T]

Read an N-dimensional PostgreSQL array column as a PgArray[T]. Requires binary column format; text-format multi-dimensional arrays are not supported. Raises PgTypeError when the column is NULL, or when the wire elemOid does not match the registered OID for T (JsonNode accepts both json and jsonb).

Validation looks only at the wire elemOid carried in the array payload, not at the column's field OID from RowDescription. A bind mismatch (e.g. reading a text[] column as getArrayND[int32]) is caught by the elemOid check; reading e.g. int4[] via getArrayND[int32] against a column declared as int8[] succeeds as long as the wire bytes match the requested T. For JsonNode, the leading jsonb version byte is stripped only when elemOid == jsonb; json payloads pass through unchanged, and any other wire elemOid (e.g. int4) is rejected by the OID check so calling getArrayND[JsonNode] on a non-JSON column raises rather than silently misinterpreting the bytes.

proc getArrayNDOpt[T](row: Row; col: int): Option[PgArray[T]]
NULL-safe column-level variant of getArrayND[T].
proc getBit(row: Row; col: int): PgBit {....raises: [PgTypeError, PgProtocolError],
    tags: [], forbids: [].}
Get a column value as PgBit. Handles both text and binary format.
proc getBitArray(row: Row; col: int): seq[PgBit] {.
    ...raises: [PgTypeError, PgProtocolError], tags: [], forbids: [].}
proc getBitArrayOpt(row`gensym515: Row; col`gensym515: int): Option[seq[PgBit]] {.
    ...raises: [PgTypeError, PgProtocolError], tags: [], forbids: [].}
proc getBitOpt(row`gensym219: Row; col`gensym219: int): Option[PgBit] {.
    ...raises: [PgTypeError, PgProtocolError], tags: [], forbids: [].}
proc getBool(row: Row; col: int): bool {.
    ...raises: [PgTypeError, PgProtocolError, PgTypeError], tags: [], forbids: [].}
Get a column value as bool. Handles binary format directly. Raises PgTypeError on NULL.
proc getBoolArray(row: Row; col: int): seq[bool] {.
    ...raises: [PgTypeError, PgProtocolError], tags: [], forbids: [].}
proc getBoolArrayElemOpt(row: Row; col: int): seq[Option[bool]] {.
    ...raises: [PgTypeError, PgProtocolError], tags: [], forbids: [].}
proc getBoolArrayElemOptOpt(row`gensym547: Row; col`gensym547: int): Option[
    seq[Option[bool]]] {....raises: [PgTypeError, PgProtocolError], tags: [],
                         forbids: [].}
proc getBoolArrayOpt(row`gensym513: Row; col`gensym513: int): Option[seq[bool]] {.
    ...raises: [PgTypeError, PgProtocolError], tags: [], forbids: [].}
proc getBoolOpt(row`gensym201: Row; col`gensym201: int): Option[bool] {.
    ...raises: [PgTypeError, PgProtocolError], tags: [], forbids: [].}
proc getBox(row: Row; col: int): PgBox {....raises: [PgTypeError, PgProtocolError],
    tags: [], forbids: [].}
Get a column value as PgBox. Handles binary format.
proc getBoxArray(row: Row; col: int): seq[PgBox] {.
    ...raises: [PgTypeError, PgProtocolError], tags: [], forbids: [].}
proc getBoxArrayOpt(row`gensym534: Row; col`gensym534: int): Option[seq[PgBox]] {.
    ...raises: [PgTypeError, PgProtocolError], tags: [], forbids: [].}
proc getBoxOpt(row`gensym224: Row; col`gensym224: int): Option[PgBox] {.
    ...raises: [PgTypeError, PgProtocolError], tags: [], forbids: [].}
proc getBytes(row: Row; col: int): seq[byte] {.
    ...raises: [PgTypeError, PgProtocolError], tags: [], forbids: [].}
Get a column value as raw bytes. Decodes bytea text output in both hex (\xDEADBEEF) and legacy escape formats. Raises PgTypeError on NULL.
proc getBytesArray(row: Row; col: int): seq[seq[byte]] {.
    ...raises: [PgTypeError, PgProtocolError], tags: [], forbids: [].}
proc getBytesArrayOpt(row`gensym529: Row; col`gensym529: int): Option[
    seq[seq[byte]]] {....raises: [PgTypeError, PgProtocolError], tags: [],
                      forbids: [].}
proc getBytesOpt(row`gensym202: Row; col`gensym202: int): Option[seq[byte]] {.
    ...raises: [PgTypeError, PgProtocolError], tags: [], forbids: [].}
proc getCidr(row: Row; col: int): PgCidr {.
    ...raises: [PgTypeError, PgProtocolError], tags: [], forbids: [].}
Get a column value as PgCidr (CIDR network address). Handles binary format.
proc getCidrArray(row: Row; col: int): seq[PgCidr] {.
    ...raises: [PgTypeError, PgProtocolError], tags: [], forbids: [].}
proc getCidrArrayOpt(row`gensym524: Row; col`gensym524: int): Option[seq[PgCidr]] {.
    ...raises: [PgTypeError, PgProtocolError], tags: [], forbids: [].}
proc getCidrOpt(row`gensym213: Row; col`gensym213: int): Option[PgCidr] {.
    ...raises: [PgTypeError, PgProtocolError], tags: [], forbids: [].}
proc getCircle(row: Row; col: int): PgCircle {.
    ...raises: [PgTypeError, PgProtocolError], tags: [], forbids: [].}
Get a column value as PgCircle. Handles binary format.
proc getCircleArray(row: Row; col: int): seq[PgCircle] {.
    ...raises: [PgTypeError, PgProtocolError], tags: [], forbids: [].}
proc getCircleArrayOpt(row`gensym537: Row; col`gensym537: int): Option[
    seq[PgCircle]] {....raises: [PgTypeError, PgProtocolError], tags: [],
                     forbids: [].}
proc getCircleOpt(row`gensym227: Row; col`gensym227: int): Option[PgCircle] {.
    ...raises: [PgTypeError, PgProtocolError], tags: [], forbids: [].}
proc getDate(row: Row; col: int): DateTime {.
    ...raises: [PgTypeError, CatchableError, PgProtocolError], tags: [TimeEffect],
    forbids: [].}
Get a column value as DateTime. Handles binary date format.
proc getDateArray(row: Row; col: int): seq[DateTime] {.
    ...raises: [PgTypeError, PgProtocolError, CatchableError], tags: [TimeEffect],
    forbids: [].}
proc getDateArrayOpt(row`gensym518: Row; col`gensym518: int): Option[
    seq[DateTime]] {....raises: [PgTypeError, PgProtocolError, CatchableError],
                     tags: [TimeEffect], forbids: [].}
proc getDateOpt(row`gensym207: Row; col`gensym207: int): Option[DateTime] {.
    ...raises: [PgTypeError, CatchableError, PgProtocolError], tags: [TimeEffect],
    forbids: [].}
proc getFloat(row: Row; col: int): float64 {....raises: [PgTypeError], tags: [],
    forbids: [].}
Get a column value as float64. Handles binary float4/8 directly. Raises PgTypeError on NULL.
proc getFloat32(row: Row; col: int): float32 {....raises: [PgTypeError], tags: [],
    forbids: [].}
Get a column value as float32. Handles binary float4 directly. Raises PgTypeError on NULL.
proc getFloat32Array(row: Row; col: int): seq[float32] {.
    ...raises: [PgTypeError, PgProtocolError], tags: [], forbids: [].}
proc getFloat32ArrayElemOpt(row: Row; col: int): seq[Option[float32]] {.
    ...raises: [PgTypeError, PgProtocolError], tags: [], forbids: [].}
proc getFloat32ArrayElemOptOpt(row`gensym546: Row; col`gensym546: int): Option[
    seq[Option[float32]]] {....raises: [PgTypeError, PgProtocolError], tags: [],
                            forbids: [].}
proc getFloat32ArrayOpt(row`gensym512: Row; col`gensym512: int): Option[
    seq[float32]] {....raises: [PgTypeError, PgProtocolError], tags: [],
                    forbids: [].}
proc getFloat32Opt(row`gensym197: Row; col`gensym197: int): Option[float32] {.
    ...raises: [PgTypeError], tags: [], forbids: [].}
proc getFloatArray(row: Row; col: int): seq[float64] {.
    ...raises: [PgTypeError, PgProtocolError], tags: [], forbids: [].}
proc getFloatArrayElemOpt(row: Row; col: int): seq[Option[float64]] {.
    ...raises: [PgTypeError, PgProtocolError], tags: [], forbids: [].}
proc getFloatArrayElemOptOpt(row`gensym545: Row; col`gensym545: int): Option[
    seq[Option[float64]]] {....raises: [PgTypeError, PgProtocolError], tags: [],
                            forbids: [].}
proc getFloatArrayOpt(row`gensym511: Row; col`gensym511: int): Option[
    seq[float64]] {....raises: [PgTypeError, PgProtocolError], tags: [],
                    forbids: [].}
proc getFloatOpt(row`gensym196: Row; col`gensym196: int): Option[float64] {.
    ...raises: [PgTypeError], tags: [], forbids: [].}
proc getHstore(row: Row; col: int): PgHstore {.
    ...raises: [PgTypeError, PgProtocolError], tags: [], forbids: [].}
Get a column value as PgHstore. Handles both text and binary format.
proc getHstoreArray(row: Row; col: int): seq[PgHstore] {.
    ...raises: [PgTypeError, PgProtocolError], tags: [], forbids: [].}
proc getHstoreArrayOpt(row`gensym541: Row; col`gensym541: int): Option[
    seq[PgHstore]] {....raises: [PgTypeError, PgProtocolError], tags: [],
                     forbids: [].}
proc getHstoreOpt(row`gensym220: Row; col`gensym220: int): Option[PgHstore] {.
    ...raises: [PgTypeError, PgProtocolError], tags: [], forbids: [].}
proc getInet(row: Row; col: int): PgInet {.
    ...raises: [PgTypeError, PgProtocolError], tags: [], forbids: [].}
Get a column value as PgInet (IP address with mask). Handles binary format.
proc getInetArray(row: Row; col: int): seq[PgInet] {.
    ...raises: [PgTypeError, PgProtocolError], tags: [], forbids: [].}
proc getInetArrayOpt(row`gensym523: Row; col`gensym523: int): Option[seq[PgInet]] {.
    ...raises: [PgTypeError, PgProtocolError], tags: [], forbids: [].}
proc getInetOpt(row`gensym212: Row; col`gensym212: int): Option[PgInet] {.
    ...raises: [PgTypeError, PgProtocolError], tags: [], forbids: [].}
proc getInt(row: Row; col: int): int32 {....raises: [PgTypeError, PgTypeError],
    tags: [], forbids: [].}
Get a column value as int32. Handles binary int2/int4 directly. Raises PgTypeError on NULL.
proc getInt16(row: Row; col: int): int16 {....raises: [PgTypeError, PgTypeError],
    tags: [], forbids: [].}
Get a column value as int16. Handles binary int2 directly. Raises PgTypeError on NULL.
proc getInt16Array(row: Row; col: int): seq[int16] {.
    ...raises: [PgTypeError, PgProtocolError], tags: [], forbids: [].}
proc getInt16ArrayElemOpt(row: Row; col: int): seq[Option[int16]] {.
    ...raises: [PgTypeError, PgProtocolError], tags: [], forbids: [].}
proc getInt16ArrayElemOptOpt(row`gensym543: Row; col`gensym543: int): Option[
    seq[Option[int16]]] {....raises: [PgTypeError, PgProtocolError], tags: [],
                          forbids: [].}
proc getInt16ArrayOpt(row`gensym509: Row; col`gensym509: int): Option[seq[int16]] {.
    ...raises: [PgTypeError, PgProtocolError], tags: [], forbids: [].}
proc getInt16Opt(row`gensym194: Row; col`gensym194: int): Option[int16] {.
    ...raises: [PgTypeError], tags: [], forbids: [].}
proc getInt64(row: Row; col: int): int64 {....raises: [PgTypeError, PgTypeError],
    tags: [], forbids: [].}
Get a column value as int64. Handles binary int2/4/8 directly. Raises PgTypeError on NULL.
proc getInt64Array(row: Row; col: int): seq[int64] {.
    ...raises: [PgTypeError, PgProtocolError, CatchableError], tags: [],
    forbids: [].}
proc getInt64ArrayElemOpt(row: Row; col: int): seq[Option[int64]] {.
    ...raises: [PgTypeError, PgProtocolError, CatchableError], tags: [],
    forbids: [].}
proc getInt64ArrayElemOptOpt(row`gensym544: Row; col`gensym544: int): Option[
    seq[Option[int64]]] {....raises: [PgTypeError, PgProtocolError, CatchableError],
                          tags: [], forbids: [].}
proc getInt64ArrayOpt(row`gensym510: Row; col`gensym510: int): Option[seq[int64]] {.
    ...raises: [PgTypeError, PgProtocolError, CatchableError], tags: [],
    forbids: [].}
proc getInt64Opt(row`gensym195: Row; col`gensym195: int): Option[int64] {.
    ...raises: [PgTypeError], tags: [], forbids: [].}
proc getIntArray(row: Row; col: int): seq[int32] {.
    ...raises: [PgTypeError, PgProtocolError, CatchableError], tags: [],
    forbids: [].}
proc getIntArrayElemOpt(row: Row; col: int): seq[Option[int32]] {.
    ...raises: [PgTypeError, PgProtocolError, CatchableError], tags: [],
    forbids: [].}
proc getIntArrayElemOptOpt(row`gensym542: Row; col`gensym542: int): Option[
    seq[Option[int32]]] {....raises: [PgTypeError, PgProtocolError, CatchableError],
                          tags: [], forbids: [].}
proc getIntArrayOpt(row`gensym508: Row; col`gensym508: int): Option[seq[int32]] {.
    ...raises: [PgTypeError, PgProtocolError, CatchableError], tags: [],
    forbids: [].}
proc getInterval(row: Row; col: int): PgInterval {.
    ...raises: [PgTypeError, PgProtocolError], tags: [], forbids: [].}
Get a column value as PgInterval. Handles binary interval format.
proc getIntervalArray(row: Row; col: int): seq[PgInterval] {.
    ...raises: [PgTypeError, PgProtocolError], tags: [], forbids: [].}
proc getIntervalArrayOpt(row`gensym521: Row; col`gensym521: int): Option[
    seq[PgInterval]] {....raises: [PgTypeError, PgProtocolError], tags: [],
                       forbids: [].}
proc getIntervalOpt(row`gensym211: Row; col`gensym211: int): Option[PgInterval] {.
    ...raises: [PgTypeError, PgProtocolError], tags: [], forbids: [].}
proc getIntOpt(row`gensym193: Row; col`gensym193: int): Option[int32] {.
    ...raises: [PgTypeError], tags: [], forbids: [].}
proc getJson(row: Row; col: int): JsonNode {....raises: [PgTypeError,
    PgProtocolError, IOError, OSError, ValueError, IOError, OSError, ValueError,
    PgTypeError], tags: [ReadIOEffect, WriteIOEffect], forbids: [].}
Get a column value as a parsed JsonNode. Handles binary json/jsonb format.
proc getJsonArray(row: Row; col: int): seq[JsonNode] {.
    ...raises: [PgTypeError, PgProtocolError, IOError, OSError, ValueError],
    tags: [ReadIOEffect, WriteIOEffect], forbids: [].}
proc getJsonArrayOpt(row`gensym530: Row; col`gensym530: int): Option[
    seq[JsonNode]] {....raises: [PgTypeError, PgProtocolError, IOError, OSError,
                              ValueError], tags: [ReadIOEffect, WriteIOEffect],
                     forbids: [].}
proc getJsonOpt(row`gensym203: Row; col`gensym203: int): Option[JsonNode] {.
    ...raises: [PgTypeError, PgProtocolError, IOError, OSError, ValueError],
    tags: [ReadIOEffect, WriteIOEffect], forbids: [].}
proc getLine(row: Row; col: int): PgLine {.
    ...raises: [PgTypeError, PgProtocolError], tags: [], forbids: [].}
Get a column value as PgLine. Handles binary format.
proc getLineArray(row: Row; col: int): seq[PgLine] {.
    ...raises: [PgTypeError, PgProtocolError], tags: [], forbids: [].}
proc getLineArrayOpt(row`gensym532: Row; col`gensym532: int): Option[seq[PgLine]] {.
    ...raises: [PgTypeError, PgProtocolError], tags: [], forbids: [].}
proc getLineOpt(row`gensym222: Row; col`gensym222: int): Option[PgLine] {.
    ...raises: [PgTypeError, PgProtocolError], tags: [], forbids: [].}
proc getLseg(row: Row; col: int): PgLseg {.
    ...raises: [PgTypeError, PgProtocolError], tags: [], forbids: [].}
Get a column value as PgLseg. Handles binary format.
proc getLsegArray(row: Row; col: int): seq[PgLseg] {.
    ...raises: [PgTypeError, PgProtocolError], tags: [], forbids: [].}
proc getLsegArrayOpt(row`gensym533: Row; col`gensym533: int): Option[seq[PgLseg]] {.
    ...raises: [PgTypeError, PgProtocolError], tags: [], forbids: [].}
proc getLsegOpt(row`gensym223: Row; col`gensym223: int): Option[PgLseg] {.
    ...raises: [PgTypeError, PgProtocolError], tags: [], forbids: [].}
proc getMacAddr(row: Row; col: int): PgMacAddr {.
    ...raises: [PgTypeError, PgProtocolError], tags: [], forbids: [].}
Get a column value as PgMacAddr. Handles binary format.
proc getMacAddr8(row: Row; col: int): PgMacAddr8 {.
    ...raises: [PgTypeError, PgProtocolError], tags: [], forbids: [].}
Get a column value as PgMacAddr8 (EUI-64). Handles binary format.
proc getMacAddr8Array(row: Row; col: int): seq[PgMacAddr8] {.
    ...raises: [PgTypeError, PgProtocolError], tags: [], forbids: [].}
proc getMacAddr8ArrayOpt(row`gensym526: Row; col`gensym526: int): Option[
    seq[PgMacAddr8]] {....raises: [PgTypeError, PgProtocolError], tags: [],
                       forbids: [].}
proc getMacAddr8Opt(row`gensym215: Row; col`gensym215: int): Option[PgMacAddr8] {.
    ...raises: [PgTypeError, PgProtocolError], tags: [], forbids: [].}
proc getMacAddrArray(row: Row; col: int): seq[PgMacAddr] {.
    ...raises: [PgTypeError, PgProtocolError], tags: [], forbids: [].}
proc getMacAddrArrayOpt(row`gensym525: Row; col`gensym525: int): Option[
    seq[PgMacAddr]] {....raises: [PgTypeError, PgProtocolError], tags: [],
                      forbids: [].}
proc getMacAddrOpt(row`gensym214: Row; col`gensym214: int): Option[PgMacAddr] {.
    ...raises: [PgTypeError, PgProtocolError], tags: [], forbids: [].}
proc getMoney(row: Row; col: int; scale: int = 2): PgMoney {.
    ...raises: [PgTypeError, PgProtocolError], tags: [], forbids: [].}
Get a column value as PgMoney. Handles binary money (8-byte int64) and locale-formatted text (see parsePgMoney for accepted forms). scale is the server's frac_digits (default 2 for C / en_US; pass 0 for ja_JP etc.). The wire protocol does not expose this, so callers must specify it when it differs from the default. Raises PgTypeError on NULL or when scale is outside 0..18.
proc getMoneyArray(row: Row; col: int; scale: int = 2): seq[PgMoney] {.
    ...raises: [PgTypeError, PgProtocolError], tags: [], forbids: [].}
Get a column value as a seq of PgMoney. Handles binary array format and locale-formatted text arrays (see parsePgMoney). scale tags each element's frac_digits and is also used for text parsing. Raises PgTypeError when scale is outside 0..18.
proc getMoneyArrayND(row: Row; col: int; scale: int = 2): PgArray[PgMoney] {.
    ...raises: [PgTypeError], tags: [], forbids: [].}
getArrayND-style accessor for money[] (any dimensionality). getArrayND[PgMoney] is intentionally {.error.}-gated because the binary money wire format does not carry the fractional-digit count, so the caller must supply scale (matching the server's lc_monetary frac_digits) — this accessor is the only way to read a money[] column. Defaults to scale = 2 for the common locale. Raises PgTypeError when scale is outside 0..18.
proc getMoneyArrayNDOpt(row: Row; col: int; scale: int = 2): Option[
    PgArray[PgMoney]] {....raises: [PgTypeError], tags: [], forbids: [].}
NULL-safe column-level variant of getMoneyArrayND.
proc getMoneyArrayOpt(row`gensym528: Row; col`gensym528: int;
                      scale`gensym528: int = 2): Option[seq[PgMoney]] {.
    ...raises: [PgTypeError, PgProtocolError], tags: [], forbids: [].}
proc getMoneyOpt(row`gensym199: Row; col`gensym199: int;
                 scale`gensym199: int = 2): Option[PgMoney] {.
    ...raises: [PgTypeError, PgProtocolError], tags: [], forbids: [].}
proc getNumeric(row: Row; col: int): PgNumeric {.
    ...raises: [PgTypeError, CatchableError, PgProtocolError], tags: [],
    forbids: [].}
Get a column value as PgNumeric. Handles binary numeric format.
proc getNumericArray(row: Row; col: int): seq[PgNumeric] {.
    ...raises: [PgTypeError, PgProtocolError, CatchableError], tags: [],
    forbids: [].}
proc getNumericArrayOpt(row`gensym527: Row; col`gensym527: int): Option[
    seq[PgNumeric]] {....raises: [PgTypeError, PgProtocolError, CatchableError],
                      tags: [], forbids: [].}
proc getNumericOpt(row`gensym198: Row; col`gensym198: int): Option[PgNumeric] {.
    ...raises: [PgTypeError, CatchableError, PgProtocolError], tags: [],
    forbids: [].}
proc getPath(row: Row; col: int): PgPath {.
    ...raises: [PgTypeError, PgProtocolError], tags: [], forbids: [].}
Get a column value as PgPath. Handles binary format.
proc getPathArray(row: Row; col: int): seq[PgPath] {.
    ...raises: [PgTypeError, PgProtocolError], tags: [], forbids: [].}
proc getPathArrayOpt(row`gensym535: Row; col`gensym535: int): Option[seq[PgPath]] {.
    ...raises: [PgTypeError, PgProtocolError], tags: [], forbids: [].}
proc getPathOpt(row`gensym225: Row; col`gensym225: int): Option[PgPath] {.
    ...raises: [PgTypeError, PgProtocolError], tags: [], forbids: [].}
proc getPoint(row: Row; col: int): PgPoint {.
    ...raises: [PgTypeError, PgProtocolError], tags: [], forbids: [].}
Get a column value as PgPoint. Handles binary format.
proc getPointArray(row: Row; col: int): seq[PgPoint] {.
    ...raises: [PgTypeError, PgProtocolError], tags: [], forbids: [].}
proc getPointArrayOpt(row`gensym531: Row; col`gensym531: int): Option[
    seq[PgPoint]] {....raises: [PgTypeError, PgProtocolError], tags: [],
                    forbids: [].}
proc getPointOpt(row`gensym221: Row; col`gensym221: int): Option[PgPoint] {.
    ...raises: [PgTypeError, PgProtocolError], tags: [], forbids: [].}
proc getPolygon(row: Row; col: int): PgPolygon {.
    ...raises: [PgTypeError, PgProtocolError], tags: [], forbids: [].}
Get a column value as PgPolygon. Handles binary format.
proc getPolygonArray(row: Row; col: int): seq[PgPolygon] {.
    ...raises: [PgTypeError, PgProtocolError], tags: [], forbids: [].}
proc getPolygonArrayOpt(row`gensym536: Row; col`gensym536: int): Option[
    seq[PgPolygon]] {....raises: [PgTypeError, PgProtocolError], tags: [],
                      forbids: [].}
proc getPolygonOpt(row`gensym226: Row; col`gensym226: int): Option[PgPolygon] {.
    ...raises: [PgTypeError, PgProtocolError], tags: [], forbids: [].}
proc getStr(row: Row; col: int): string {.
    ...raises: [PgTypeError, PgProtocolError], tags: [], forbids: [].}
Get a column value as a string. Handles binary-to-text conversion for common types (bool, int2/4/8, float4/8, numeric). Raises PgTypeError on NULL, or on a binary-safe OID this proc cannot stringify — use a typed accessor or resultFormat = rfText in that case.
proc getStrArray(row: Row; col: int): seq[string] {.
    ...raises: [PgTypeError, PgProtocolError], tags: [], forbids: [].}
proc getStrArrayElemOpt(row: Row; col: int): seq[Option[string]] {.
    ...raises: [PgTypeError, PgProtocolError], tags: [], forbids: [].}
proc getStrArrayElemOptOpt(row`gensym548: Row; col`gensym548: int): Option[
    seq[Option[string]]] {....raises: [PgTypeError, PgProtocolError], tags: [],
                           forbids: [].}
proc getStrArrayOpt(row`gensym514: Row; col`gensym514: int): Option[seq[string]] {.
    ...raises: [PgTypeError, PgProtocolError], tags: [], forbids: [].}
proc getStrOpt(row`gensym192: Row; col`gensym192: int): Option[string] {.
    ...raises: [PgTypeError, PgProtocolError], tags: [], forbids: [].}
proc getTime(row: Row; col: int): PgTime {.
    ...raises: [PgTypeError, PgProtocolError], tags: [], forbids: [].}
Get a column value as PgTime. Handles binary time format.
proc getTimeArray(row: Row; col: int): seq[PgTime] {.
    ...raises: [PgTypeError, PgProtocolError], tags: [], forbids: [].}
proc getTimeArrayOpt(row`gensym519: Row; col`gensym519: int): Option[seq[PgTime]] {.
    ...raises: [PgTypeError, PgProtocolError], tags: [], forbids: [].}
proc getTimeOpt(row`gensym208: Row; col`gensym208: int): Option[PgTime] {.
    ...raises: [PgTypeError, PgProtocolError], tags: [], forbids: [].}
proc getTimestamp(row: Row; col: int): DateTime {.
    ...raises: [PgTypeError, PgProtocolError, CatchableError], tags: [TimeEffect],
    forbids: [].}
Get a column value as DateTime. Handles binary timestamp format.
proc getTimestampArray(row: Row; col: int): seq[DateTime] {.
    ...raises: [PgTypeError, PgProtocolError, CatchableError], tags: [TimeEffect],
    forbids: [].}
proc getTimestampArrayOpt(row`gensym516: Row; col`gensym516: int): Option[
    seq[DateTime]] {....raises: [PgTypeError, PgProtocolError, CatchableError],
                     tags: [TimeEffect], forbids: [].}
proc getTimestampOpt(row`gensym206: Row; col`gensym206: int): Option[DateTime] {.
    ...raises: [PgTypeError, PgProtocolError, CatchableError], tags: [TimeEffect],
    forbids: [].}
proc getTimestampTz(row: Row; col: int): DateTime {.
    ...raises: [PgTypeError, PgProtocolError, CatchableError], tags: [TimeEffect],
    forbids: [].}
Get a column value as DateTime from a timestamptz column.
proc getTimestampTzArray(row: Row; col: int): seq[DateTime] {.
    ...raises: [PgTypeError, PgProtocolError, CatchableError], tags: [TimeEffect],
    forbids: [].}
proc getTimestampTzArrayOpt(row`gensym517: Row; col`gensym517: int): Option[
    seq[DateTime]] {....raises: [PgTypeError, PgProtocolError, CatchableError],
                     tags: [TimeEffect], forbids: [].}
proc getTimestampTzOpt(row`gensym210: Row; col`gensym210: int): Option[DateTime] {.
    ...raises: [PgTypeError, PgProtocolError, CatchableError], tags: [TimeEffect],
    forbids: [].}
proc getTimeTz(row: Row; col: int): PgTimeTz {.
    ...raises: [PgTypeError, PgProtocolError], tags: [], forbids: [].}
Get a column value as PgTimeTz. Handles binary timetz format.
proc getTimeTzArray(row: Row; col: int): seq[PgTimeTz] {.
    ...raises: [PgTypeError, PgProtocolError], tags: [], forbids: [].}
proc getTimeTzArrayOpt(row`gensym520: Row; col`gensym520: int): Option[
    seq[PgTimeTz]] {....raises: [PgTypeError, PgProtocolError], tags: [],
                     forbids: [].}
proc getTimeTzOpt(row`gensym209: Row; col`gensym209: int): Option[PgTimeTz] {.
    ...raises: [PgTypeError, PgProtocolError], tags: [], forbids: [].}
proc getTsQuery(row: Row; col: int): PgTsQuery {.
    ...raises: [PgTypeError, PgProtocolError], tags: [], forbids: [].}
Get a column value as PgTsQuery. Handles both text and binary format.
proc getTsQueryArray(row: Row; col: int): seq[PgTsQuery] {.
    ...raises: [PgTypeError, PgProtocolError], tags: [], forbids: [].}
proc getTsQueryArrayOpt(row`gensym540: Row; col`gensym540: int): Option[
    seq[PgTsQuery]] {....raises: [PgTypeError, PgProtocolError], tags: [],
                      forbids: [].}
proc getTsQueryOpt(row`gensym217: Row; col`gensym217: int): Option[PgTsQuery] {.
    ...raises: [PgTypeError, PgProtocolError], tags: [], forbids: [].}
proc getTsVector(row: Row; col: int): PgTsVector {.
    ...raises: [PgTypeError, PgProtocolError], tags: [], forbids: [].}
Get a column value as PgTsVector. Handles both text and binary format.
proc getTsVectorArray(row: Row; col: int): seq[PgTsVector] {.
    ...raises: [PgTypeError, PgProtocolError], tags: [], forbids: [].}
proc getTsVectorArrayOpt(row`gensym539: Row; col`gensym539: int): Option[
    seq[PgTsVector]] {....raises: [PgTypeError, PgProtocolError], tags: [],
                       forbids: [].}
proc getTsVectorOpt(row`gensym216: Row; col`gensym216: int): Option[PgTsVector] {.
    ...raises: [PgTypeError, PgProtocolError], tags: [], forbids: [].}
proc getUuid(row: Row; col: int): PgUuid {.
    ...raises: [PgTypeError, PgProtocolError], tags: [], forbids: [].}
Get a column value as PgUuid. Handles binary format (16 bytes).
proc getUuidArray(row: Row; col: int): seq[PgUuid] {.
    ...raises: [PgTypeError, PgProtocolError], tags: [], forbids: [].}
proc getUuidArrayOpt(row`gensym522: Row; col`gensym522: int): Option[seq[PgUuid]] {.
    ...raises: [PgTypeError, PgProtocolError], tags: [], forbids: [].}
proc getUuidOpt(row`gensym200: Row; col`gensym200: int): Option[PgUuid] {.
    ...raises: [PgTypeError, PgProtocolError], tags: [], forbids: [].}
proc getXml(row: Row; col: int): PgXml {....raises: [PgTypeError, PgProtocolError],
    tags: [], forbids: [].}
Get a column value as PgXml. Handles both text and binary format.
proc getXmlArray(row: Row; col: int): seq[PgXml] {.
    ...raises: [PgTypeError, PgProtocolError], tags: [], forbids: [].}
proc getXmlArrayOpt(row`gensym538: Row; col`gensym538: int): Option[seq[PgXml]] {.
    ...raises: [PgTypeError, PgProtocolError], tags: [], forbids: [].}
proc getXmlOpt(row`gensym218: Row; col`gensym218: int): Option[PgXml] {.
    ...raises: [PgTypeError, PgProtocolError], tags: [], forbids: [].}
proc initCommandResult(tag: string): CommandResult {.inline, ...raises: [],
    tags: [], forbids: [].}
proc isBinaryCol(row: Row; col: int): bool {.inline, ...raises: [], tags: [],
    forbids: [].}
Check if column was received in binary format.
proc isNull(row: Row; col: int): bool {....raises: [PgTypeError], tags: [],
                                        forbids: [].}
Check if the column value is NULL. Raises PgTypeError on out-of-range column index (see cellInfo for why not IndexDefect).
proc len(row: Row): int {.inline, ...raises: [], tags: [], forbids: [].}
Return the number of columns in this row.

Converters

converter toRow(cells: seq[Option[seq[byte]]]): Row {....raises: [], tags: [],
    forbids: [].}
Backward-compatible converter: build a Row from seq[Option[seq[byte]]].

Templates

template nameAccessor(getProc: untyped; T: typedesc)
Generate getProc*(row, name): T that delegates to the index-based overload. Auto-detects a scale parameter on the index-based proc and forwards it — so a scaled accessor like getMoney cannot silently drop the kwarg when its index-based signature grows one.
template optAccessor(getProc, optProc: untyped; T: typedesc)
Generate optProc*(row, col): Option[T] that delegates to getProc.