Skip to content

Commit 3ec5826

Browse files
committed
address PR comments
1 parent fafac79 commit 3ec5826

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

query_executor.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,9 @@ type ExecutableStatement interface {
5151
// (currently Query and Batch via Session.Query and Session.Batch)
5252
type Statement interface {
5353
Iter() *Iter
54+
IterContext(ctx context.Context) *Iter
5455
Exec() error
56+
ExecContext(ctx context.Context) error
5557
}
5658

5759
type internalRequest interface {
@@ -341,7 +343,6 @@ type internalQuery struct {
341343
qryOpts *queryOptions
342344
pageState []byte
343345
metrics *queryMetrics
344-
refCount uint32
345346
conn *Conn
346347
consistency uint32
347348
session *Session
@@ -565,6 +566,7 @@ func newInternalBatch(batch *Batch, ctx context.Context) *internalBatch {
565566
metrics: &queryMetrics{m: make(map[string]*hostMetrics)},
566567
routingInfo: &queryRoutingInfo{},
567568
session: batch.session,
569+
consistency: uint32(batch.GetConsistency()),
568570
}
569571
}
570572

session.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -722,9 +722,9 @@ func (b *Batch) ExecContext(ctx context.Context) error {
722722

723723
// Iter executes a batch operation and returns an Iter object
724724
// that can be used to access properties related to the execution like Iter.Attempts and Iter.Latency
725-
func (b *Batch) Iter() *Iter { return b.session.executeBatch(b, nil) }
725+
func (b *Batch) Iter() *Iter { return b.IterContext(nil) }
726726

727-
// Iter executes a batch operation with the provided context and returns an Iter object
727+
// IterContext executes a batch operation with the provided context and returns an Iter object
728728
// that can be used to access properties related to the execution like Iter.Attempts and Iter.Latency
729729
func (b *Batch) IterContext(ctx context.Context) *Iter {
730730
return b.session.executeBatch(b, ctx)

0 commit comments

Comments
 (0)