Skip to content
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

Consider moving some of the Rows methods to a new type #552

Closed
flimzy opened this issue Jan 6, 2022 · 0 comments · Fixed by #554
Closed

Consider moving some of the Rows methods to a new type #552

flimzy opened this issue Jan 6, 2022 · 0 comments · Fixed by #554

Comments

@flimzy
Copy link
Member

flimzy commented Jan 6, 2022

Some of the Rows methods return data this is only available after iterating the entire result set. This has lead to several bug reports, because it's not very intuitive.

Perhaps a new method can be added that returns these values while closing the iterator. Perhaps `Finish() would be a good name?

// ResultMetadata contains metadata about certain queries.
type ResultMetadata struct {
    Offset int64
    TotalRows int64
    UpdateSeq string
    Warning string
    QueryIndex int
    Bookmark string
}

// Finish iterates through any remaining items in the iterator, and collects summary metadata, then closes the iterator.
func (*Rows) Finish() (ResultMetadata, error)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant