Upgrade gocql to 1.15.3 (#343)
gocql 1.15.3 brings new APIs for `gocql.Batch` and `gocql.Query`: - `SetRequestTimeout` - `GetRequestTimeout` So, this change adds relative APIs to the `gocqlx.Batch` and `gocqlx.Queryx`.
This commit is contained in:
15
batchx.go
15
batchx.go
@@ -3,6 +3,8 @@ package gocqlx
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
"time"
|
||||
|
||||
"github.com/gocql/gocql"
|
||||
)
|
||||
|
||||
@@ -34,6 +36,19 @@ func (s *Session) ContextBatch(ctx context.Context, bt gocql.BatchType) *Batch {
|
||||
}
|
||||
}
|
||||
|
||||
// GetRequestTimeout returns time driver waits for single server response
|
||||
// This timeout is applied to preparing statement request and for query execution requests
|
||||
func (b *Batch) GetRequestTimeout() time.Duration {
|
||||
return b.Batch.GetRequestTimeout()
|
||||
}
|
||||
|
||||
// SetRequestTimeout sets time driver waits for server to respond
|
||||
// This timeout is applied to preparing statement request and for query execution requests
|
||||
func (b *Batch) SetRequestTimeout(timeout time.Duration) *Batch {
|
||||
b.Batch.SetRequestTimeout(timeout)
|
||||
return b
|
||||
}
|
||||
|
||||
// SetHostID allows to define the host the query should be executed against. If the
|
||||
// host was filtered or otherwise unavailable, then the query will error. If an empty
|
||||
// string is sent, the default behavior, using the configured HostSelectionPolicy will
|
||||
|
||||
Reference in New Issue
Block a user