github.com/ydb-platform/ydb-go-sdk/v3@v3.57.0/internal/query/row.go (about)

     1  package query
     2  
     3  import (
     4  	"github.com/ydb-platform/ydb-go-genproto/protos/Ydb"
     5  
     6  	"github.com/ydb-platform/ydb-go-sdk/v3/internal/query/scanner"
     7  	"github.com/ydb-platform/ydb-go-sdk/v3/query"
     8  )
     9  
    10  var _ query.Row = (*row)(nil)
    11  
    12  type row struct {
    13  	scanner.IndexedScanner
    14  	scanner.NamedScanner
    15  	scanner.StructScanner
    16  }
    17  
    18  func newRow(columns []*Ydb.Column, v *Ydb.Value) (*row, error) {
    19  	data := scanner.Data(columns, v.GetItems())
    20  
    21  	return &row{
    22  		scanner.Indexed(data),
    23  		scanner.Named(data),
    24  		scanner.Struct(data),
    25  	}, nil
    26  }