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:
14
queryx.go
14
queryx.go
@@ -10,6 +10,7 @@ import (
|
||||
"fmt"
|
||||
"reflect"
|
||||
"strconv"
|
||||
"time"
|
||||
|
||||
"github.com/gocql/gocql"
|
||||
"github.com/scylladb/go-reflectx"
|
||||
@@ -147,6 +148,19 @@ func (q *Queryx) BindStructMap(arg0 interface{}, arg1 map[string]interface{}) *Q
|
||||
return q
|
||||
}
|
||||
|
||||
// GetRequestTimeout returns time driver waits for single server response
|
||||
// This timeout is applied to preparing statement request and for query execution requests
|
||||
func (q *Queryx) GetRequestTimeout() time.Duration {
|
||||
return q.Query.GetRequestTimeout()
|
||||
}
|
||||
|
||||
// SetRequestTimeout sets time driver waits for server to respond
|
||||
// This timeout is applied to preparing statement request and for query execution requests
|
||||
func (q *Queryx) SetRequestTimeout(timeout time.Duration) *Queryx {
|
||||
q.Query.SetRequestTimeout(timeout)
|
||||
return q
|
||||
}
|
||||
|
||||
// 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