RelResult

open class RelResult : OptionalRustObject

Wraps a Rel result from a Mentat query. A Rel result is a list of rows of TypedValues. Individual rows can be fetched or the set can be iterated.

To fetch individual rows from a RelResult use row(Int32).

query.run { rows in
   let row1 = rows.row(0)
   let row2 = rows.row(1)
}

To iterate over the result set use standard iteration flows.

query.run { rows in
    rows.forEach { row in
        ...
    }
}

Note that iteration is consuming and can only be done once.

  • Fetch the row at the requested index.

    Throws

    PointerError.pointerConsumed if the result set has already been iterated.

    Declaration

    Swift

    open func row(index: Int32) throws -> TupleResult?

    Parameters

    index

    the index of the row to be fetched

    Return Value

    The row at the requested index as a TupleResult, if present, or nil if there is no row at that index.

  • Undocumented

    Declaration

    Swift

    override open func cleanup(pointer: OpaquePointer)