Introduce Unsafe method on Queryx
It enables local control over `unsafe` mode for .Bind methods of `Queryx` and iterators spawn by it.
This commit is contained in:
committed by
Sylwia Szunejko
parent
a222c1f067
commit
c6f942afc7
@@ -484,12 +484,8 @@ func TestIterxUnsafe(t *testing.T) {
|
||||
})
|
||||
|
||||
t.Run("select default unsafe", func(t *testing.T) {
|
||||
gocqlx.DefaultUnsafe = true
|
||||
defer func() {
|
||||
gocqlx.DefaultUnsafe = false
|
||||
}()
|
||||
var v []UnsafeTable
|
||||
err := session.Query(stmt, nil).Iter().Select(&v)
|
||||
err := session.Query(stmt, nil).Unsafe().Iter().Select(&v)
|
||||
if err != nil {
|
||||
t.Fatal("Select() failed:", err)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user