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:
Dmitry Kropachev
2025-09-08 06:25:00 -04:00
committed by GitHub
parent 9f74b689a9
commit 25cee51cac
7 changed files with 36 additions and 8 deletions

View File

@@ -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