docs(writer): clarify RowIterator ownership for helper APIs#148
Conversation
Document that WriteRowIterator and RunRowIterator own the passed iterator, prefer direct txn.Query passing, and return RowIteratorResult for post-run metadata and stats. Fixes #144 Co-authored-by: Cursor <cursoragent@cursor.com>
There was a problem hiding this comment.
Code Review
This pull request updates the documentation in README.md, doc.go, and row_iterator.go to clarify iterator ownership and lifecycle management when using WriteRowIterator and RunRowIterator versus manual loops. The review feedback focuses on improving GoDoc link resolution on pkg.go.dev by using fully qualified paths for external package references (like iterator.Done) and correctly formatting pointer receiver methods with a '*' prefix (like *spanner.RowIterator.Stop).
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
Use fully qualified iterator.Done in doc.go and *-receiver Stop links in row_iterator godoc so pkg.go.dev resolves external references. Co-authored-by: Cursor <cursoragent@cursor.com>
|
/gemini review |
There was a problem hiding this comment.
Code Review
This pull request updates the documentation in README.md, doc.go, and row_iterator.go to clarify iterator ownership for WriteRowIterator and RunRowIterator, explaining that these helpers manage the lifecycle of the passed iterator. The review feedback suggests using fully qualified package paths for external method links in GoDoc to ensure correct resolution on pkg.go.dev.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
Match pkg.go.dev link style used elsewhere in writer package docs. Co-authored-by: Cursor <cursoragent@cursor.com>
|
/gemini review |
There was a problem hiding this comment.
Code Review
This pull request updates the documentation in README.md, doc.go, and row_iterator.go to clarify iterator ownership for WriteRowIterator and RunRowIterator. It explains that these helpers own the passed iterator, consume it, and call Stop(), and advises callers to pass newly created iterators directly rather than binding them and deferring Stop() at the call site. It also clarifies the expected behavior and usage for manual loops. There are no review comments, and I have no feedback to provide.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
Summary
WriteRowIteratorandRunRowIteratorown the passed*spanner.RowIterator: they consume it, callStop(), and returnRowIteratorResultfor post-run metadata and stats.txn.Query(ctx, stmt)) instead of bindingiteranddefer iter.Stop()at the call site.Nextloops remain different: bind the iterator,defer iter.Stop(), and read metadata or stats only after consuming toiterator.Done.writer/README.mdexamples to use directtxn.Query/txn.QueryWithStatspassing.Fixes #144
Test plan
make checkMade with Cursor