MCPcopy Create free account
hub / github.com/cloudspannerecosystem/spanner-cli / DecodeRow

Function DecodeRow

decoder.go:29–43  ·  view source on GitHub ↗
(row *spanner.Row)

Source from the content-addressed store, hash-verified

27)
28
29func DecodeRow(row *spanner.Row) ([]string, error) {
30 columns := make([]string, row.Size())
31 for i := 0; i < row.Size(); i++ {
32 var column spanner.GenericColumnValue
33 if err := row.Column(i, &column); err != nil {
34 return nil, err
35 }
36 decoded, err := DecodeColumn(column)
37 if err != nil {
38 return nil, err
39 }
40 columns[i] = decoded
41 }
42 return columns, nil
43}
44
45func DecodeColumn(column spanner.GenericColumnValue) (string, error) {
46 // Allowable types: https://cloud.google.com/spanner/docs/data-types#allowable-types

Callers 3

DecodeColumnFunction · 0.85
parseQueryResultFunction · 0.85
TestDecodeRowFunction · 0.85

Calls 1

DecodeColumnFunction · 0.85

Tested by 1

TestDecodeRowFunction · 0.68