Added Context variants of Query functions
This commit is contained in:
committed by
Michal Jan Matczuk
parent
8af6506cde
commit
4ea6f42a51
@@ -9,6 +9,7 @@ package qb
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"context"
|
||||
"time"
|
||||
|
||||
"github.com/scylladb/gocqlx/v2"
|
||||
@@ -85,6 +86,11 @@ func (b *InsertBuilder) Query(session gocqlx.Session) *gocqlx.Queryx {
|
||||
return session.Query(b.ToCql())
|
||||
}
|
||||
|
||||
// QueryContext returns query wrapped with context built on top of current InsertBuilder state.
|
||||
func (b *InsertBuilder) QueryContext(ctx context.Context, session gocqlx.Session) *gocqlx.Queryx {
|
||||
return b.Query(session).WithContext(ctx)
|
||||
}
|
||||
|
||||
// Into sets the INTO clause of the query.
|
||||
func (b *InsertBuilder) Into(table string) *InsertBuilder {
|
||||
b.table = table
|
||||
|
||||
Reference in New Issue
Block a user