StreamedResultSet API

Wrapper for streaming results.

class google.cloud.spanner_v1.streamed.StreamedResultSet(response_iterator, source=None)

Bases: object

Process a sequence of partial result sets into a single set of row data.

  • Parameters

    • response_iterator – Iterator yielding google.cloud.spanner_v1.proto.result_set_pb2.PartialResultSet instances.

    • source (Snapshot) – Snapshot from which the result set was fetched.

property fields()

Field descriptors for result set columns.

  • Return type

    list of Field

  • Returns

    list of fields describing column names / types.

property metadata()

Result set metadata

  • Return type

    ResultSetMetadata

  • Returns

    structure describing the results

one()

Return exactly one result, or raise an exception.

  • Raises

    NotFound: If there are no results.

  • Raises

    ValueError: If there are multiple results.

  • Raises

    RuntimeError: If consumption has already occurred, in whole or in part.

one_or_none()

Return exactly one result, or None if there are no results.

  • Raises

    ValueError: If there are multiple results.

  • Raises

    RuntimeError: If consumption has already occurred, in whole or in part.

property stats()

Result set statistics

  • Return type

    ResultSetStats

  • Returns

    structure describing status about the response

exception google.cloud.spanner_v1.streamed.Unmergeable(lhs, rhs, type_)

Bases: ValueError

Unable to merge two values.