table: Added cql.builders for insert, update, delete to enable table batch timestamp at statement granularity.

This commit is contained in:
xiang.wang
2020-03-13 10:56:00 +08:00
committed by Michal Jan Matczuk
parent ab2a96d9f3
commit fc0b7be8ab
2 changed files with 34 additions and 2 deletions

View File

@@ -171,6 +171,17 @@ func TestTableUpdate(t *testing.T) {
t.Error(diff, names)
}
}
// run UpdateBuilder on the same data set
for _, test := range table {
stmt, names := New(test.M).UpdateBuilder(test.C...).ToCql()
if diff := cmp.Diff(test.S, stmt); diff != "" {
t.Error(diff)
}
if diff := cmp.Diff(test.N, names); diff != "" {
t.Error(diff, names)
}
}
}
func TestTableDelete(t *testing.T) {
@@ -220,6 +231,17 @@ func TestTableDelete(t *testing.T) {
t.Error(diff, names)
}
}
// run DeleteBuilder on the same data set
for _, test := range table {
stmt, names := New(test.M).DeleteBuilder(test.C...).ToCql()
if diff := cmp.Diff(test.S, stmt); diff != "" {
t.Error(diff)
}
if diff := cmp.Diff(test.N, names); diff != "" {
t.Error(diff, names)
}
}
}
func TestTableConcurrentUsage(t *testing.T) {