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 ¶
- func CollectListValues(rowIter *spanner.RowIterator, opts ...spaniter.Option) ([]*structpb.ListValue, error)
- func FromIteratorResult(rows []*structpb.ListValue, result spaniter.RowIteratorResult) (*sppb.ResultSet, error)
- func Materialize(rowIter *spanner.RowIterator, redact bool, opts ...spaniter.Option) (*sppb.ResultSet, error)
- func RowToListValue(r *spanner.Row) *structpb.ListValue
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.
Types ¶
This section is empty.