New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
spanner: provide column types in results #1805
Comments
|
Hi @rakyll, I think currently, using In client library, we have the type info in // ColumnRawTypes returns all column raw types of the row.
func (r *Row) ColumnRawTypes() []*sppb.Type {
var n []string
for _, c := range r.fields {
n = append(n, c.Type)
}
return n
} |
Hi @rakyll , do you think whether or not the proposed method is a solution for your problem? or have you already solved your problem? Is this still a feature that you would like us to add? |
|
I want to see
I believe it is useful to write a generic client application. |
It does seem that the Go client does not return the metadata of a result set, which makes it impossible to determine the column names and types of an empty result set. |
Adds ResultSetMetaData to the RowIterator struct. The metadata are available after the first call to RowIterator.Next() as long as that call did not return any other error than iterator.Done. Fixes #1805
Adds ResultSetMetaData to the RowIterator struct. The metadata are available after the first call to RowIterator.Next() as long as that call did not return any other error than iterator.Done. Fixes #1805
The underlying proto contains ResultSetMetadata.RowType for results returned from the API but spanner.Row or spanner.RowIterator are not surfacing them to the user. I'm trying to put together a "database/sql" driver for Spanner and without the column type it is not possible.
/cc @tbpg
The text was updated successfully, but these errors were encountered: