Skip to content

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

Closed
@flimzy

Description

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)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions