resultset

package
v0.5.0-alpha.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 28, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package resultset drains Cloud Spanner row iterators into protobuf ResultSets.

It composes github.com/apstndb/spaniter for iterator lifecycle and stats conversion. Callers that need jq-shaped maps should use github.com/apstndb/execspansql/jqresult on top of the returned ResultSet.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CollectListValues

func CollectListValues(rowIter *spanner.RowIterator, opts ...spaniter.Option) ([]*structpb.ListValue, error)

CollectListValues drains rowIter into protobuf row values. rowIter must not have been read yet unless opts configure partial consumption.

func FromIteratorResult

func FromIteratorResult(rows []*structpb.ListValue, result spaniter.RowIteratorResult) (*sppb.ResultSet, error)

FromIteratorResult constructs a ResultSet from materialized rows and drained iterator state. rows may be nil when row values are intentionally redacted. Stats encoding comes from spaniter drain options such as WithStatsEncoding.

func Materialize

func Materialize(rowIter *spanner.RowIterator, redact bool, opts ...spaniter.Option) (*sppb.ResultSet, error)

Materialize drains rowIter and returns a protobuf ResultSet. rowIter must not have been read yet; Materialize owns and stops it. When redact is true, row values are omitted but metadata and stats are preserved. Stats encoding is configured via spaniter options such as WithStatsEncoding.

func RowToListValue

func RowToListValue(r *spanner.Row) *structpb.ListValue

RowToListValue converts a Spanner row to structpb.ListValue.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL