qb: add support for USING TIMEOUT clause

In scylladb/scylla#7781 we added possibility to add timeout as part of USING spec.
This patch adds support for it by adding `Timeout` and `TimeoutNamed` functions to builders.

Fixes #194
This commit is contained in:
Michał Matczuk
2021-08-03 11:29:54 +02:00
committed by Michal Jan Matczuk
parent 96a8de1e1e
commit 979397bc5e
12 changed files with 198 additions and 2 deletions

View File

@@ -92,6 +92,19 @@ func (b *DeleteBuilder) TimestampNamed(name string) *DeleteBuilder {
return b
}
// Timeout adds USING TIMEOUT clause to the query.
func (b *DeleteBuilder) Timeout(d time.Duration) *DeleteBuilder {
b.using.Timeout(d)
return b
}
// TimeoutNamed adds a USING TIMEOUT clause to the query with a custom
// parameter name.
func (b *DeleteBuilder) TimeoutNamed(name string) *DeleteBuilder {
b.using.TimeoutNamed(name)
return b
}
// Where adds an expression to the WHERE clause of the query. Expressions are
// ANDed together in the generated CQL.
func (b *DeleteBuilder) Where(w ...Cmp) *DeleteBuilder {