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
@@ -126,6 +126,17 @@ func TestUpdateBuilder(t *testing.T) {
|
||||
S: "UPDATE cycling.cyclist_name USING TIMESTAMP ? SET id=?,user_uuid=?,firstname=? WHERE id=? ",
|
||||
N: []string{"ts", "id", "user_uuid", "firstname", "expr"},
|
||||
},
|
||||
// Add TIMEOUT
|
||||
{
|
||||
B: Update("cycling.cyclist_name").Set("id", "user_uuid", "firstname").Where(w).Timeout(time.Second),
|
||||
S: "UPDATE cycling.cyclist_name USING TIMEOUT 1s SET id=?,user_uuid=?,firstname=? WHERE id=? ",
|
||||
N: []string{"id", "user_uuid", "firstname", "expr"},
|
||||
},
|
||||
{
|
||||
B: Update("cycling.cyclist_name").Set("id", "user_uuid", "firstname").Where(w).TimeoutNamed("to"),
|
||||
S: "UPDATE cycling.cyclist_name USING TIMEOUT ? SET id=?,user_uuid=?,firstname=? WHERE id=? ",
|
||||
N: []string{"to", "id", "user_uuid", "firstname", "expr"},
|
||||
},
|
||||
// Add IF EXISTS
|
||||
{
|
||||
B: Update("cycling.cyclist_name").Set("id", "user_uuid", "firstname").Where(w).Existing(),
|
||||
|
||||
Reference in New Issue
Block a user