Skip to content

Commit b8ac46a

Browse files
authored
Merge pull request #63 from ydb-platform/result-set
moved HasNextResultSet from unary result interface to common result i…
2 parents 3bf2541 + 9b64054 commit b8ac46a

File tree

3 files changed

+8
-12
lines changed

3 files changed

+8
-12
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@
1717
* Added `DoTx()` API method into `table.Client`
1818
* Added `String()` method into `ConnectParams` for serialize params to connection string
1919
* Added early exit from Rollback for committed transaction
20+
* Moved `HasNextResultSet()` method from `Result` interface to common `result` interface.
21+
It provides access to `HasNextResultSet()` on both result interfaces (unary and stream results)
2022

2123
## 3.4.4
2224
* Prefer `ydb.table.types.Scanner` scanner implementation over `sql.Scanner`, when both available.

table/result/result.go

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,12 @@ import (
2929
// After that, NextResultSet(), NextRow() will return false.
3030
type result interface {
3131

32+
// HasNextResultSet reports whether result set may be advanced.
33+
// It may be useful to call HasNextResultSet() instead of NextResultSet() to look ahead
34+
// without advancing the result set.
35+
// Note that it does not work with sets from stream.
36+
HasNextResultSet() bool
37+
3238
// NextResultSet selects next result set in the result.
3339
// columns - names of columns in the resultSet that will be scanned
3440
// It returns false if there are no more result sets.
@@ -99,19 +105,9 @@ type result interface {
99105
type Result interface {
100106
result
101107

102-
// HasNextResultSet reports whether result set may be advanced.
103-
// It may be useful to call HasNextResultSet() instead of NextResultSet() to look ahead
104-
// without advancing the result set.
105-
// Note that it does not work with sets from stream.
106-
HasNextResultSet() bool
107-
108108
// ResultSetCount returns number of result sets.
109109
// Note that it does not work if r is the result of streaming operation.
110110
ResultSetCount() int
111-
112-
// TotalRowCount returns the number of rows among the all result sets.
113-
// Note that it does not work if r is the result of streaming operation.
114-
TotalRowCount() int
115111
}
116112

117113
type StreamResult interface {

trace/table.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,9 +66,7 @@ type (
6666
}
6767
result interface {
6868
resultErr
69-
7069
ResultSetCount() int
71-
TotalRowCount() int
7270
}
7371
SessionNewStartInfo struct {
7472
// Context make available context in trace callback function.

0 commit comments

Comments
 (0)