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"
|
||||
@@ -61,6 +62,11 @@ func (b *DeleteBuilder) Query(session gocqlx.Session) *gocqlx.Queryx {
|
||||
return session.Query(b.ToCql())
|
||||
}
|
||||
|
||||
// QueryContext returns query wrapped with context built on top of current DeleteBuilder state.
|
||||
func (b *DeleteBuilder) QueryContext(ctx context.Context, session gocqlx.Session) *gocqlx.Queryx {
|
||||
return b.Query(session).WithContext(ctx)
|
||||
}
|
||||
|
||||
// From sets the table to be deleted from.
|
||||
func (b *DeleteBuilder) From(table string) *DeleteBuilder {
|
||||
b.table = table
|
||||
|
||||
Reference in New Issue
Block a user