You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
CREATE TABLE test (
id INT64 NOT NULL,
name STRING(MAX),
) PRIMARY KEY (id);
Expected behavior
SelectAll, when passed a slice of
struct {
ID int64
Name string
}
should behave like Row.ToStruct, and perform case-insensitive comparison between the column name and the field name. In this case, this means mapping the id column to the ID field, and the name column to the Name field.
Actual behavior
Contrary to Row.ToStruct, SelectAll does not perform a case-insensitive compare, and thus returns the error Go struct {ID:0 Name:}(type reflect.Value) has no or duplicate fields for Cloud Spanner STRUCT field id.
Adding field tags like
struct {
ID int64 `spanner:"id"`
Name string `spanner:"name"`
}
makes the problem go away, but Row.ToStruct does not require them.
The text was updated successfully, but these errors were encountered:
Assume a table like
Expected behavior
SelectAll
, when passed a slice ofshould behave like
Row.ToStruct
, and perform case-insensitive comparison between the column name and the field name. In this case, this means mapping theid
column to theID
field, and thename
column to theName
field.Actual behavior
Contrary to
Row.ToStruct
,SelectAll
does not perform a case-insensitive compare, and thus returns the errorGo struct {ID:0 Name:}(type reflect.Value) has no or duplicate fields for Cloud Spanner STRUCT field id
.Adding field tags like
makes the problem go away, but
Row.ToStruct
does not require them.The text was updated successfully, but these errors were encountered: