Skip to content

Commit 18cd427

Browse files
committed
Added WithConcurrentResultSets option
1 parent 46c6b87 commit 18cd427

File tree

3 files changed

+20
-1
lines changed

3 files changed

+20
-1
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: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ type (
4444
retryOptions []retry.Option
4545
responsePartLimitBytes int64
4646
label string
47+
concurrentResultSets bool
4748
}
4849

4950
// Execute is an interface for execute method options
@@ -70,6 +71,7 @@ type (
7071
}
7172
execModeOption = ExecMode
7273
responsePartLimitBytes int64
74+
concurrentResultSets bool
7375
)
7476

7577
func (poolID resourcePool) applyExecuteOption(s *executeSettings) {
@@ -119,6 +121,10 @@ func (mode ExecMode) applyExecuteOption(s *executeSettings) {
119121
s.execMode = mode
120122
}
121123

124+
func (opt concurrentResultSets) applyExecuteOption(s *executeSettings) {
125+
s.concurrentResultSets = bool(opt)
126+
}
127+
122128
const (
123129
ExecModeParse = ExecMode(Ydb_Query.ExecMode_EXEC_MODE_PARSE)
124130
ExecModeValidate = ExecMode(Ydb_Query.ExecMode_EXEC_MODE_VALIDATE)
@@ -192,6 +198,10 @@ func (s *executeSettings) Label() string {
192198
return s.label
193199
}
194200

201+
func (s *executeSettings) ConcurrentResultSets() bool {
202+
return s.concurrentResultSets
203+
}
204+
195205
func WithParameters(params params.Parameters) parametersOption {
196206
return parametersOption{
197207
params: params,
@@ -224,6 +234,10 @@ func WithResponsePartLimitSizeBytes(size int64) responsePartLimitBytes {
224234
return responsePartLimitBytes(size)
225235
}
226236

237+
func WithConcurrentResultSets(isEnabled bool) concurrentResultSets {
238+
return concurrentResultSets(isEnabled)
239+
}
240+
227241
func (size responsePartLimitBytes) applyExecuteOption(s *executeSettings) {
228242
s.responsePartLimitBytes = int64(size)
229243
}

query/execute_options.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,10 @@ func WithResponsePartLimitSizeBytes(size int64) ExecuteOption {
6363
return options.WithResponsePartLimitSizeBytes(size)
6464
}
6565

66+
//func WithConcurrentResultSets(isEnabled bool) ExecuteOption {
67+
// return options.WithConcurrentResultSets(isEnabled)
68+
//}
69+
6670
func WithCallOptions(opts ...grpc.CallOption) ExecuteOption {
6771
return options.WithCallOptions(opts...)
6872
}

0 commit comments

Comments
 (0)