Skip to content

Commit 8f235f3

Browse files
committed
Added WithConcurrentResultSets option
1 parent 98f0612 commit 8f235f3

File tree

3 files changed

+23
-2
lines changed

3 files changed

+23
-2
lines changed

internal/query/execute_query.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ type executeSettings interface {
3232
ResourcePool() string
3333
ResponsePartLimitSizeBytes() int64
3434
Label() string
35+
ConcurrentResultSets() bool
3536
}
3637

3738
type executeScriptConfig interface {
@@ -92,7 +93,7 @@ func executeQueryRequest(sessionID, q string, cfg executeSettings) (
9293
},
9394
Parameters: params,
9495
StatsMode: Ydb_Query.StatsMode(cfg.StatsMode()),
95-
ConcurrentResultSets: false,
96+
ConcurrentResultSets: cfg.ConcurrentResultSets(),
9697
PoolId: cfg.ResourcePool(),
9798
ResponsePartLimitBytes: cfg.ResponsePartLimitSizeBytes(),
9899
}

internal/query/options/execute.go

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ type (
4646
issueCallback func(issues []*Ydb_Issue.IssueMessage)
4747
responsePartLimitBytes int64
4848
label string
49+
concurrentResultSets bool
4950
}
5051

5152
// Execute is an interface for execute method options
@@ -72,9 +73,12 @@ type (
7273
}
7374
execModeOption = ExecMode
7475
responsePartLimitBytes int64
75-
issuesOption struct {
76+
77+
issuesOption struct {
7678
callback func([]*Ydb_Issue.IssueMessage)
7779
}
80+
81+
concurrentResultSets bool
7882
)
7983

8084
func (poolID resourcePool) applyExecuteOption(s *executeSettings) {
@@ -132,6 +136,10 @@ func (opts issuesOption) applyExecuteOption(s *executeSettings) {
132136
s.issueCallback = opts.callback
133137
}
134138

139+
func (opt concurrentResultSets) applyExecuteOption(s *executeSettings) {
140+
s.concurrentResultSets = bool(opt)
141+
}
142+
135143
const (
136144
ExecModeParse = ExecMode(Ydb_Query.ExecMode_EXEC_MODE_PARSE)
137145
ExecModeValidate = ExecMode(Ydb_Query.ExecMode_EXEC_MODE_VALIDATE)
@@ -205,6 +213,10 @@ func (s *executeSettings) Label() string {
205213
return s.label
206214
}
207215

216+
func (s *executeSettings) ConcurrentResultSets() bool {
217+
return s.concurrentResultSets
218+
}
219+
208220
func WithParameters(params params.Parameters) parametersOption {
209221
return parametersOption{
210222
params: params,
@@ -237,6 +249,10 @@ func WithResponsePartLimitSizeBytes(size int64) responsePartLimitBytes {
237249
return responsePartLimitBytes(size)
238250
}
239251

252+
func WithConcurrentResultSets(isEnabled bool) concurrentResultSets {
253+
return concurrentResultSets(isEnabled)
254+
}
255+
240256
func (size responsePartLimitBytes) applyExecuteOption(s *executeSettings) {
241257
s.responsePartLimitBytes = int64(size)
242258
}

query/execute_options.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,10 @@ func WithResponsePartLimitSizeBytes(size int64) ExecuteOption {
7070
return options.WithResponsePartLimitSizeBytes(size)
7171
}
7272

73+
//func WithConcurrentResultSets(isEnabled bool) ExecuteOption {
74+
// return options.WithConcurrentResultSets(isEnabled)
75+
//}
76+
7377
func WithCallOptions(opts ...grpc.CallOption) ExecuteOption {
7478
return options.WithCallOptions(opts...)
7579
}

0 commit comments

Comments
 (0)