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:
committed by
Michal Jan Matczuk
parent
96a8de1e1e
commit
979397bc5e
13
qb/update.go
13
qb/update.go
@@ -117,6 +117,19 @@ func (b *UpdateBuilder) TimestampNamed(name string) *UpdateBuilder {
|
||||
return b
|
||||
}
|
||||
|
||||
// Timeout adds USING TIMEOUT clause to the query.
|
||||
func (b *UpdateBuilder) Timeout(d time.Duration) *UpdateBuilder {
|
||||
b.using.Timeout(d)
|
||||
return b
|
||||
}
|
||||
|
||||
// TimeoutNamed adds a USING TIMEOUT clause to the query with a custom
|
||||
// parameter name.
|
||||
func (b *UpdateBuilder) TimeoutNamed(name string) *UpdateBuilder {
|
||||
b.using.TimeoutNamed(name)
|
||||
return b
|
||||
}
|
||||
|
||||
// Set adds SET clauses to the query.
|
||||
// To set a tuple column use SetTuple instead.
|
||||
func (b *UpdateBuilder) Set(columns ...string) *UpdateBuilder {
|
||||
|
||||
Reference in New Issue
Block a user