Merge "syncbase: fixing vet violations"
diff --git a/v23/syncbase/nosql/internal/query/query_checker/query_checker.go b/v23/syncbase/nosql/internal/query/query_checker/query_checker.go
index 5927845..d28c9e2 100644
--- a/v23/syncbase/nosql/internal/query/query_checker/query_checker.go
+++ b/v23/syncbase/nosql/internal/query/query_checker/query_checker.go
@@ -21,7 +21,7 @@
 )
 
 var (
-	KeyRangeAll = query_db.KeyRange{"", MaxRangeLimit}
+	KeyRangeAll = query_db.KeyRange{Start: "", Limit: MaxRangeLimit}
 )
 
 func Check(db query_db.Database, s *query_parser.Statement) error {
@@ -401,7 +401,7 @@
 	if prefix == "" {
 		return KeyRangeAll
 	}
-	return query_db.KeyRange{prefix, afterPrefix(prefix)}
+	return query_db.KeyRange{Start: prefix, Limit: afterPrefix(prefix)}
 }
 
 func computeKeyRangesForNotLike(prefix string) *query_db.KeyRanges {
@@ -409,8 +409,8 @@
 		return &query_db.KeyRanges{KeyRangeAll}
 	}
 	return &query_db.KeyRanges{
-		query_db.KeyRange{"", prefix},
-		query_db.KeyRange{afterPrefix(prefix), ""},
+		query_db.KeyRange{Start: "", Limit: prefix},
+		query_db.KeyRange{Start: afterPrefix(prefix), Limit: ""},
 	}
 }
 
@@ -420,7 +420,7 @@
 func computeKeyRangeForSingleValue(start string) query_db.KeyRange {
 	limit := []byte(start)
 	limit = append(limit, 0)
-	return query_db.KeyRange{start, string(limit)}
+	return query_db.KeyRange{Start: start, Limit: string(limit)}
 }
 
 // Compute a list of key ranges to be used by query_db's Table.Scan implementation.
@@ -446,7 +446,7 @@
 		} else {
 			limit = rhs.Limit
 		}
-		return &query_db.KeyRange{start, limit}
+		return &query_db.KeyRange{Start: start, Limit: limit}
 	}
 	return nil
 }
@@ -514,21 +514,21 @@
 			case query_parser.Equal:
 				return &query_db.KeyRanges{computeKeyRangeForSingleValue(expr.Operand2.Str)}
 			case query_parser.GreaterThan:
-				return &query_db.KeyRanges{query_db.KeyRange{string(append([]byte(expr.Operand2.Str), 0)), MaxRangeLimit}}
+				return &query_db.KeyRanges{query_db.KeyRange{Start: string(append([]byte(expr.Operand2.Str), 0)), Limit: MaxRangeLimit}}
 			case query_parser.GreaterThanOrEqual:
-				return &query_db.KeyRanges{query_db.KeyRange{expr.Operand2.Str, MaxRangeLimit}}
+				return &query_db.KeyRanges{query_db.KeyRange{Start: expr.Operand2.Str, Limit: MaxRangeLimit}}
 			case query_parser.Like:
 				return &query_db.KeyRanges{computeKeyRangeForLike(expr.Operand2.Prefix)}
 			case query_parser.NotLike:
 				return computeKeyRangesForNotLike(expr.Operand2.Prefix)
 			case query_parser.LessThan:
-				return &query_db.KeyRanges{query_db.KeyRange{"", expr.Operand2.Str}}
+				return &query_db.KeyRanges{query_db.KeyRange{Start: "", Limit: expr.Operand2.Str}}
 			case query_parser.LessThanOrEqual:
-				return &query_db.KeyRanges{query_db.KeyRange{"", string(append([]byte(expr.Operand2.Str), 0))}}
+				return &query_db.KeyRanges{query_db.KeyRange{Start: "", Limit: string(append([]byte(expr.Operand2.Str), 0))}}
 			default: // case query_parser.NotEqual:
 				return &query_db.KeyRanges{
-					query_db.KeyRange{"", expr.Operand2.Str},
-					query_db.KeyRange{string(append([]byte(expr.Operand2.Str), 0)), MaxRangeLimit},
+					query_db.KeyRange{Start: "", Limit: expr.Operand2.Str},
+					query_db.KeyRange{Start: string(append([]byte(expr.Operand2.Str), 0)), Limit: MaxRangeLimit},
 				}
 			}
 		} else if isStringLiteral(expr.Operand1) {
@@ -537,17 +537,17 @@
 			case query_parser.Equal:
 				return &query_db.KeyRanges{computeKeyRangeForSingleValue(expr.Operand1.Str)}
 			case query_parser.GreaterThan:
-				return &query_db.KeyRanges{query_db.KeyRange{"", expr.Operand1.Str}}
+				return &query_db.KeyRanges{query_db.KeyRange{Start: "", Limit: expr.Operand1.Str}}
 			case query_parser.GreaterThanOrEqual:
-				return &query_db.KeyRanges{query_db.KeyRange{"", string(append([]byte(expr.Operand1.Str), 0))}}
+				return &query_db.KeyRanges{query_db.KeyRange{Start: "", Limit: string(append([]byte(expr.Operand1.Str), 0))}}
 			case query_parser.LessThan:
-				return &query_db.KeyRanges{query_db.KeyRange{string(append([]byte(expr.Operand1.Str), 0)), MaxRangeLimit}}
+				return &query_db.KeyRanges{query_db.KeyRange{Start: string(append([]byte(expr.Operand1.Str), 0)), Limit: MaxRangeLimit}}
 			case query_parser.LessThanOrEqual:
-				return &query_db.KeyRanges{query_db.KeyRange{expr.Operand1.Str, MaxRangeLimit}}
+				return &query_db.KeyRanges{query_db.KeyRange{Start: expr.Operand1.Str, Limit: MaxRangeLimit}}
 			default: // case query_parser.NotEqual:
 				return &query_db.KeyRanges{
-					query_db.KeyRange{"", expr.Operand1.Str},
-					query_db.KeyRange{string(append([]byte(expr.Operand1.Str), 0)), MaxRangeLimit},
+					query_db.KeyRange{Start: "", Limit: expr.Operand1.Str},
+					query_db.KeyRange{Start: string(append([]byte(expr.Operand1.Str), 0)), Limit: MaxRangeLimit},
 				}
 			}
 		} else {
diff --git a/v23/syncbase/nosql/internal/query/query_checker/query_checker_test.go b/v23/syncbase/nosql/internal/query/query_checker/query_checker_test.go
index 9d410b0..95f1469 100644
--- a/v23/syncbase/nosql/internal/query/query_checker/query_checker_test.go
+++ b/v23/syncbase/nosql/internal/query/query_checker/query_checker_test.go
@@ -177,66 +177,66 @@
 		{
 			"select k, v from Customer",
 			&query_db.KeyRanges{
-				query_db.KeyRange{"", ""},
+				query_db.KeyRange{Start: "", Limit: ""},
 			},
 		},
 		{
 			"select k, v from Customer where k = \"abc\" or k = \"def\"",
 			&query_db.KeyRanges{
-				query_db.KeyRange{"abc", appendZeroByte("abc")},
-				query_db.KeyRange{"def", appendZeroByte("def")},
+				query_db.KeyRange{Start: "abc", Limit: appendZeroByte("abc")},
+				query_db.KeyRange{Start: "def", Limit: appendZeroByte("def")},
 			},
 		},
 		{
 			"select k, v from Customer where \"abc\" = k or \"def\" = k",
 			&query_db.KeyRanges{
-				query_db.KeyRange{"abc", appendZeroByte("abc")},
-				query_db.KeyRange{"def", appendZeroByte("def")},
+				query_db.KeyRange{Start: "abc", Limit: appendZeroByte("abc")},
+				query_db.KeyRange{Start: "def", Limit: appendZeroByte("def")},
 			},
 		},
 		{
 			"select k, v from Customer where k >= \"foo\" and k < \"goo\"",
 			&query_db.KeyRanges{
-				query_db.KeyRange{"foo", "goo"},
+				query_db.KeyRange{Start: "foo", Limit: "goo"},
 			},
 		},
 		{
 			"select k, v from Customer where \"foo\" <= k and \"goo\" >= k",
 			&query_db.KeyRanges{
-				query_db.KeyRange{"foo", appendZeroByte("goo")},
+				query_db.KeyRange{Start: "foo", Limit: appendZeroByte("goo")},
 			},
 		},
 		{
 			"select k, v from Customer where k <> \"foo\"",
 			&query_db.KeyRanges{
-				query_db.KeyRange{"", "foo"},
-				query_db.KeyRange{appendZeroByte("foo"), ""},
+				query_db.KeyRange{Start: "", Limit: "foo"},
+				query_db.KeyRange{Start: appendZeroByte("foo"), Limit: ""},
 			},
 		},
 		{
 			"select k, v from Customer where k <> \"foo\" and k > \"bar\"",
 			&query_db.KeyRanges{
-				query_db.KeyRange{appendZeroByte("bar"), "foo"},
-				query_db.KeyRange{appendZeroByte("foo"), ""},
+				query_db.KeyRange{Start: appendZeroByte("bar"), Limit: "foo"},
+				query_db.KeyRange{Start: appendZeroByte("foo"), Limit: ""},
 			},
 		},
 		{
 			"select k, v from Customer where k <> \"foo\" or k > \"bar\"",
 			&query_db.KeyRanges{
-				query_db.KeyRange{"", ""},
+				query_db.KeyRange{Start: "", Limit: ""},
 			},
 		},
 		{
 			"select k, v from Customer where k <> \"bar\" or k > \"foo\"",
 			&query_db.KeyRanges{
-				query_db.KeyRange{"", "bar"},
-				query_db.KeyRange{appendZeroByte("bar"), ""},
+				query_db.KeyRange{Start: "", Limit: "bar"},
+				query_db.KeyRange{Start: appendZeroByte("bar"), Limit: ""},
 			},
 		},
 		{
 			"select v from Customer where Type(v) = \"Foo.Bar\" and k >= \"100\" and k < \"200\" and v.foo > 50 and v.bar <= 1000 and v.baz <> -20.7",
 			&query_db.KeyRanges{
-				query_db.KeyRange{"100", "200"},
+				query_db.KeyRange{Start: "100", Limit: "200"},
 			},
 		},
 		{
@@ -246,13 +246,13 @@
 		{
 			"select k, v from Customer where Type(v) = \"Foo.Bar\" and k like \"abc%\" limit 100 offset 200",
 			&query_db.KeyRanges{
-				query_db.KeyRange{"abc", "abd"},
+				query_db.KeyRange{Start: "abc", Limit: "abd"},
 			},
 		},
 		{
 			"select  k,  v from \n  Customer where k like \"002%\" or k like \"001%\" or k like \"%\"",
 			&query_db.KeyRanges{
-				query_db.KeyRange{"", ""},
+				query_db.KeyRange{Start: "", Limit: ""},
 			},
 		},
 		{
@@ -266,45 +266,45 @@
 		{
 			"select k, v from Customer where k like \"foo%\" or k like \"bar%\"",
 			&query_db.KeyRanges{
-				query_db.KeyRange{"bar", "bas"},
-				query_db.KeyRange{"foo", "fop"},
+				query_db.KeyRange{Start: "bar", Limit: "bas"},
+				query_db.KeyRange{Start: "foo", Limit: "fop"},
 			},
 		},
 		{
 			// Note: 'like "Foo"' is optimized to '= "Foo"
 			"select k, v from Customer where k = \"Foo.Bar\" or k like \"Foo\" or k like \"abc%\" limit 100 offset 200",
 			&query_db.KeyRanges{
-				query_db.KeyRange{"Foo", appendZeroByte("Foo")},
-				query_db.KeyRange{"Foo.Bar", appendZeroByte("Foo.Bar")},
-				query_db.KeyRange{"abc", "abd"},
+				query_db.KeyRange{Start: "Foo", Limit: appendZeroByte("Foo")},
+				query_db.KeyRange{Start: "Foo.Bar", Limit: appendZeroByte("Foo.Bar")},
+				query_db.KeyRange{Start: "abc", Limit: "abd"},
 			},
 		},
 		{
 			"select k, v from Customer where k like \"Foo\\%Bar\" or k like \"abc%\" limit 100 offset 200",
 			&query_db.KeyRanges{
-				query_db.KeyRange{"Foo%Bar", appendZeroByte("Foo%Bar")},
-				query_db.KeyRange{"abc", "abd"},
+				query_db.KeyRange{Start: "Foo%Bar", Limit: appendZeroByte("Foo%Bar")},
+				query_db.KeyRange{Start: "abc", Limit: "abd"},
 			},
 		},
 		{
 			"select k, v from Customer where k like \"Foo\\\\%Bar\" or k like \"abc%\" limit 100 offset 200",
 			&query_db.KeyRanges{
-				query_db.KeyRange{"Foo\\", "Foo]"},
-				query_db.KeyRange{"abc", "abd"},
+				query_db.KeyRange{Start: "Foo\\", Limit: "Foo]"},
+				query_db.KeyRange{Start: "abc", Limit: "abd"},
 			},
 		},
 		{
 			"select k, v from Customer where k like \"Foo\\\\\\%Bar\" or k like \"abc%\" limit 100 offset 200",
 			&query_db.KeyRanges{
-				query_db.KeyRange{"Foo\\%Bar", appendZeroByte("Foo\\%Bar")},
-				query_db.KeyRange{"abc", "abd"},
+				query_db.KeyRange{Start: "Foo\\%Bar", Limit: appendZeroByte("Foo\\%Bar")},
+				query_db.KeyRange{Start: "abc", Limit: "abd"},
 			},
 		},
 		{
 			"select k, v from Customer where k not like \"002%\"",
 			&query_db.KeyRanges{
-				query_db.KeyRange{"", "002"},
-				query_db.KeyRange{"003", ""},
+				query_db.KeyRange{Start: "", Limit: "002"},
+				query_db.KeyRange{Start: "003", Limit: ""},
 			},
 		},
 	}
diff --git a/v23/syncbase/nosql/internal/query/test/query_test.go b/v23/syncbase/nosql/internal/query/test/query_test.go
index b8c2e9c..3c5464d 100644
--- a/v23/syncbase/nosql/internal/query/test/query_test.go
+++ b/v23/syncbase/nosql/internal/query/test/query_test.go
@@ -2033,7 +2033,7 @@
 			// Need all keys
 			"select k, v from Customer",
 			&query_db.KeyRanges{
-				query_db.KeyRange{"", ""},
+				query_db.KeyRange{Start: "", Limit: ""},
 			},
 			nil,
 		},
@@ -2041,8 +2041,8 @@
 			// Keys 001 or 003
 			"   select  k,  v from Customer where k = \"001\" or k = \"003\"",
 			&query_db.KeyRanges{
-				query_db.KeyRange{"001", appendZeroByte("001")},
-				query_db.KeyRange{"003", appendZeroByte("003")},
+				query_db.KeyRange{Start: "001", Limit: appendZeroByte("001")},
+				query_db.KeyRange{Start: "003", Limit: appendZeroByte("003")},
 			},
 			nil,
 		},
@@ -2056,7 +2056,7 @@
 			// Need all keys
 			"select  k,  v from Customer where k like \"%\" or k like \"001%\" or k like \"002%\"",
 			&query_db.KeyRanges{
-				query_db.KeyRange{"", ""},
+				query_db.KeyRange{Start: "", Limit: ""},
 			},
 			nil,
 		},
@@ -2064,7 +2064,7 @@
 			// Need all keys, likes in where clause in different order
 			"select  k,  v from Customer where k like \"002%\" or k like \"001%\" or k like \"%\"",
 			&query_db.KeyRanges{
-				query_db.KeyRange{"", ""},
+				query_db.KeyRange{Start: "", Limit: ""},
 			},
 			nil,
 		},
@@ -2072,7 +2072,7 @@
 			// All selected rows will have key prefix of "abc".
 			"select k, v from Customer where Type(v) like \"%.Foo.Bar\" and k like \"abc%\"",
 			&query_db.KeyRanges{
-				query_db.KeyRange{"abc", plusOne("abc")},
+				query_db.KeyRange{Start: "abc", Limit: plusOne("abc")},
 			},
 			nil,
 		},
@@ -2080,7 +2080,7 @@
 			// Need all keys
 			"select k, v from Customer where Type(v) like \"%.Foo.Bar\" or k like \"abc%\"",
 			&query_db.KeyRanges{
-				query_db.KeyRange{"", ""},
+				query_db.KeyRange{Start: "", Limit: ""},
 			},
 			nil,
 		},
@@ -2088,7 +2088,7 @@
 			// Need all keys
 			"select k, v from Customer where k like \"abc%\" or v.zip = \"94303\"",
 			&query_db.KeyRanges{
-				query_db.KeyRange{"", ""},
+				query_db.KeyRange{Start: "", Limit: ""},
 			},
 			nil,
 		},
@@ -2096,7 +2096,7 @@
 			// All selected rows will have key prefix of "foo".
 			"select k, v from Customer where Type(v) like \"%.Foo.Bar\" and k like \"foo_bar\"",
 			&query_db.KeyRanges{
-				query_db.KeyRange{"foo", plusOne("foo")},
+				query_db.KeyRange{Start: "foo", Limit: plusOne("foo")},
 			},
 			nil,
 		},
@@ -2104,8 +2104,8 @@
 			// All selected rows will have key == "baz" or prefix of "foo".
 			"select k, v from Customer where k like \"foo_bar\" or k = \"baz\"",
 			&query_db.KeyRanges{
-				query_db.KeyRange{"baz", appendZeroByte("baz")},
-				query_db.KeyRange{"foo", plusOne("foo")},
+				query_db.KeyRange{Start: "baz", Limit: appendZeroByte("baz")},
+				query_db.KeyRange{Start: "foo", Limit: plusOne("foo")},
 			},
 			nil,
 		},
@@ -2113,8 +2113,8 @@
 			// All selected rows will have key == "fo" or prefix of "foo".
 			"select k, v from Customer where k like \"foo_bar\" or k = \"fo\"",
 			&query_db.KeyRanges{
-				query_db.KeyRange{"fo", appendZeroByte("fo")},
-				query_db.KeyRange{"foo", plusOne("foo")},
+				query_db.KeyRange{Start: "fo", Limit: appendZeroByte("fo")},
+				query_db.KeyRange{Start: "foo", Limit: plusOne("foo")},
 			},
 			nil,
 		},
@@ -2123,7 +2123,7 @@
 			// k == foo is a subset of above prefix
 			"select k, v from Customer where k like \"fo_bar\" or k = \"foo\"",
 			&query_db.KeyRanges{
-				query_db.KeyRange{"fo", plusOne("fo")},
+				query_db.KeyRange{Start: "fo", Limit: plusOne("fo")},
 			},
 			nil,
 		},
@@ -2131,7 +2131,7 @@
 			// All selected rows will have key prefix of "foo".
 			"select k, v from Customer where k like \"foo%bar\"",
 			&query_db.KeyRanges{
-				query_db.KeyRange{"foo", plusOne("foo")},
+				query_db.KeyRange{Start: "foo", Limit: plusOne("foo")},
 			},
 			nil,
 		},
@@ -2139,7 +2139,7 @@
 			// Select "foo\bar" row.
 			"select k, v from Customer where k like \"foo\\\\bar\"",
 			&query_db.KeyRanges{
-				query_db.KeyRange{"foo\\bar", appendZeroByte("foo\\bar")},
+				query_db.KeyRange{Start: "foo\\bar", Limit: appendZeroByte("foo\\bar")},
 			},
 			nil,
 		},
@@ -2147,7 +2147,7 @@
 			// Select "foo%bar" row.
 			"select k, v from Customer where k like \"foo\\%bar\"",
 			&query_db.KeyRanges{
-				query_db.KeyRange{"foo%bar", appendZeroByte("foo%bar")},
+				query_db.KeyRange{Start: "foo%bar", Limit: appendZeroByte("foo%bar")},
 			},
 			nil,
 		},
@@ -2155,7 +2155,7 @@
 			// Select "foo\%bar" row.
 			"select k, v from Customer where k like \"foo\\\\\\%bar\"",
 			&query_db.KeyRanges{
-				query_db.KeyRange{"foo\\%bar", appendZeroByte("foo\\%bar")},
+				query_db.KeyRange{Start: "foo\\%bar", Limit: appendZeroByte("foo\\%bar")},
 			},
 			nil,
 		},
@@ -2163,7 +2163,7 @@
 			// Need all keys
 			"select k, v from Customer where k like \"%foo\"",
 			&query_db.KeyRanges{
-				query_db.KeyRange{"", ""},
+				query_db.KeyRange{Start: "", Limit: ""},
 			},
 			nil,
 		},
@@ -2171,7 +2171,7 @@
 			// Need all keys
 			"select k, v from Customer where k like \"_foo\"",
 			&query_db.KeyRanges{
-				query_db.KeyRange{"", ""},
+				query_db.KeyRange{Start: "", Limit: ""},
 			},
 			nil,
 		},
@@ -2179,7 +2179,7 @@
 			// Select "foo_bar" row.
 			"select k, v from Customer where k like \"foo\\_bar\"",
 			&query_db.KeyRanges{
-				query_db.KeyRange{"foo_bar", appendZeroByte("foo_bar")},
+				query_db.KeyRange{Start: "foo_bar", Limit: appendZeroByte("foo_bar")},
 			},
 			nil,
 		},
@@ -2187,7 +2187,7 @@
 			// Select "foobar%" row.
 			"select k, v from Customer where k like \"foobar\\%\"",
 			&query_db.KeyRanges{
-				query_db.KeyRange{"foobar%", appendZeroByte("foobar%")},
+				query_db.KeyRange{Start: "foobar%", Limit: appendZeroByte("foobar%")},
 			},
 			nil,
 		},
@@ -2195,7 +2195,7 @@
 			// Select "foobar_" row.
 			"select k, v from Customer where k like \"foobar\\_\"",
 			&query_db.KeyRanges{
-				query_db.KeyRange{"foobar_", appendZeroByte("foobar_")},
+				query_db.KeyRange{Start: "foobar_", Limit: appendZeroByte("foobar_")},
 			},
 			nil,
 		},
@@ -2203,7 +2203,7 @@
 			// Select "\%_" row.
 			"select k, v from Customer where k like \"\\\\\\%\\_\"",
 			&query_db.KeyRanges{
-				query_db.KeyRange{"\\%_", appendZeroByte("\\%_")},
+				query_db.KeyRange{Start: "\\%_", Limit: appendZeroByte("\\%_")},
 			},
 			nil,
 		},
@@ -2211,7 +2211,7 @@
 			// Select "%_abc\" row.
 			"select k, v from Customer where k = \"%_abc\\\"",
 			&query_db.KeyRanges{
-				query_db.KeyRange{"%_abc\\", appendZeroByte("%_abc\\")},
+				query_db.KeyRange{Start: "%_abc\\", Limit: appendZeroByte("%_abc\\")},
 			},
 			nil,
 		},
diff --git a/x/ref/services/syncbase/server/util/glob.go b/x/ref/services/syncbase/server/util/glob.go
index 8cf15a5..4a73870 100644
--- a/x/ref/services/syncbase/server/util/glob.go
+++ b/x/ref/services/syncbase/server/util/glob.go
@@ -27,14 +27,14 @@
 		parts := SplitKeyParts(string(key))
 		name := parts[len(parts)-1]
 		if matcher.Match(name) {
-			if err := call.SendStream().Send(naming.GlobChildrenReplyName{name}); err != nil {
+			if err := call.SendStream().Send(naming.GlobChildrenReplyName{Value: name}); err != nil {
 				return err
 			}
 		}
 	}
 	if err := it.Err(); err != nil {
 		vlog.VI(1).Infof("Glob() failed: %v", err)
-		call.SendStream().Send(naming.GlobChildrenReplyError{naming.GlobError{Error: err}})
+		call.SendStream().Send(naming.GlobChildrenReplyError{Value: naming.GlobError{Error: err}})
 	}
 	return nil
 }
diff --git a/x/ref/services/syncbase/vsync/watcher_test.go b/x/ref/services/syncbase/vsync/watcher_test.go
index c730e77..be77b94 100644
--- a/x/ref/services/syncbase/vsync/watcher_test.go
+++ b/x/ref/services/syncbase/vsync/watcher_test.go
@@ -117,7 +117,7 @@
 	for _, test := range checkSyncableTests {
 		log := &watchable.LogEntry{
 			Op: watchable.OpPut{
-				watchable.PutOp{Key: []byte(makeRowKey(test.key))},
+				Value: watchable.PutOp{Key: []byte(makeRowKey(test.key))},
 			},
 		}
 		res := syncable(appDbName(test.appName, test.dbName), log)
@@ -144,7 +144,7 @@
 func newSGLog(prefixes []string, remove bool) *watchable.LogEntry {
 	return &watchable.LogEntry{
 		Op: watchable.OpSyncGroup{
-			watchable.SyncGroupOp{Prefixes: prefixes, Remove: remove},
+			Value: watchable.SyncGroupOp{Prefixes: prefixes, Remove: remove},
 		},
 	}
 }
diff --git a/x/ref/syncbase/sb51/internal/writer/writer_test.go b/x/ref/syncbase/sb51/internal/writer/writer_test.go
index d19b43f..3d7c1f2 100644
--- a/x/ref/syncbase/sb51/internal/writer/writer_test.go
+++ b/x/ref/syncbase/sb51/internal/writer/writer_test.go
@@ -21,6 +21,40 @@
 	curr int
 }
 
+var (
+	customer = db.Customer{
+		Name:   "John Smith",
+		Id:     1,
+		Active: true,
+		Address: db.AddressInfo{
+			Street: "1 Main St.",
+			City:   "Palo Alto",
+			State:  "CA",
+			Zip:    "94303",
+		},
+		Credit: db.CreditReport{
+			Agency: db.CreditAgencyEquifax,
+			Report: db.AgencyReportEquifaxReport{Value: db.EquifaxCreditReport{Rating: 'A'}},
+		},
+	}
+	invoice = db.Invoice{
+		CustId:     1,
+		InvoiceNum: 1000,
+		Amount:     42,
+		ShipTo: db.AddressInfo{
+			Street: "1 Main St.",
+			City:   "Palo Alto",
+			State:  "CA",
+			Zip:    "94303",
+		},
+	}
+)
+
+func array2String(s1, s2 string) db.Array2String {
+	a := [2]string{s1, s2}
+	return db.Array2String(a)
+}
+
 func newResultStream(iRows [][]interface{}) nosql.ResultStream {
 	vRows := make([][]*vdl.Value, len(iRows))
 	for i, iRow := range iRows {
@@ -161,10 +195,7 @@
 		},
 		{
 			[]string{"c1"},
-			[][]interface{}{
-				{db.Customer{"John Smith", 1, true, db.AddressInfo{"1 Main St.", "Palo Alto", "CA", "94303"}, db.CreditReport{Agency: db.CreditAgencyEquifax, Report: db.AgencyReportEquifaxReport{db.EquifaxCreditReport{'A'}}}}},
-				{db.Invoice{1, 1000, 42, db.AddressInfo{"1 Main St.", "Palo Alto", "CA", "94303"}}},
-			},
+			[][]interface{}{{customer}, {invoice}},
 			`
 +------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
 |                                                                                                                                                                                       c1 |
@@ -177,7 +208,7 @@
 		{
 			[]string{"c1"},
 			[][]interface{}{
-				{db.Composite{db.Array2String{"foo", "棎鶊鵱"}, []int32{1, 2}, map[int32]struct{}{1: struct{}{}, 2: struct{}{}}, map[string]int32{"foo": 1, "bar": 2}}},
+				{db.Composite{array2String("foo", "棎鶊鵱"), []int32{1, 2}, map[int32]struct{}{1: struct{}{}, 2: struct{}{}}, map[string]int32{"foo": 1, "bar": 2}}},
 			},
 			`
 +----------------------------------------------------------------------------------+
@@ -204,10 +235,21 @@
 			[]string{"c1"},
 			[][]interface{}{
 				{
-					db.Recursive{nil, &db.Times{time.Unix(123456789, 42244224), time.Duration(13377331)}, map[db.Array2String]db.Recursive{
-						db.Array2String{"a", "b"}:       db.Recursive{},
-						db.Array2String{"x\nx", "y\"y"}: db.Recursive{vdl.ValueOf(db.AgencyReportExperianReport{db.ExperianCreditReport{db.ExperianRatingGood}}), nil, nil},
-					}},
+					db.Recursive{
+						Any: nil,
+						Maybe: &db.Times{
+							Stamp:    time.Unix(123456789, 42244224),
+							Interval: time.Duration(13377331),
+						},
+						Rec: map[db.Array2String]db.Recursive{
+							array2String("a", "b"): db.Recursive{},
+							array2String("x\nx", "y\"y"): db.Recursive{
+								Any:   vdl.ValueOf(db.AgencyReportExperianReport{Value: db.ExperianCreditReport{Rating: db.ExperianRatingGood}}),
+								Maybe: nil,
+								Rec:   nil,
+							},
+						},
+					},
 				},
 			},
 			`
@@ -324,10 +366,7 @@
 		},
 		{
 			[]string{"c1"},
-			[][]interface{}{
-				{db.Customer{"John Smith", 1, true, db.AddressInfo{"1 Main St.", "Palo Alto", "CA", "94303"}, db.CreditReport{Agency: db.CreditAgencyEquifax, Report: db.AgencyReportEquifaxReport{db.EquifaxCreditReport{'A'}}}}},
-				{db.Invoice{1, 1000, 42, db.AddressInfo{"1 Main St.", "Palo Alto", "CA", "94303"}}},
-			},
+			[][]interface{}{{customer}, {invoice}},
 			",",
 			`
 c1
@@ -450,10 +489,7 @@
 		},
 		{
 			[]string{"c1"},
-			[][]interface{}{
-				{db.Customer{"John Smith", 1, true, db.AddressInfo{"1 Main St.", "Palo Alto", "CA", "94303"}, db.CreditReport{Agency: db.CreditAgencyEquifax, Report: db.AgencyReportEquifaxReport{db.EquifaxCreditReport{'A'}}}}},
-				{db.Invoice{1, 1000, 42, db.AddressInfo{"1 Main St.", "Palo Alto", "CA", "94303"}}},
-			},
+			[][]interface{}{{customer}, {invoice}},
 			`
 [{
   "c1": {"Name":"John Smith","Id":1,"Active":true,"Address":{"Street":"1 Main St.","City":"Palo Alto","State":"CA","Zip":"94303"},"Credit":{"Agency":"Equifax","Report":{"EquifaxReport":{"Rating":65}}}}
@@ -467,7 +503,7 @@
 			[][]interface{}{
 				{
 					nil,
-					db.Composite{db.Array2String{"foo", "bar"}, []int32{1, 2}, map[int32]struct{}{1: struct{}{}, 2: struct{}{}}, map[string]int32{"foo": 1, "bar": 2}},
+					db.Composite{array2String("foo", "bar"), []int32{1, 2}, map[int32]struct{}{1: struct{}{}, 2: struct{}{}}, map[string]int32{"foo": 1, "bar": 2}},
 					vdl.TypeOf(map[string]struct{}{}),
 				},
 			},
@@ -483,10 +519,23 @@
 			[]string{"c1"},
 			[][]interface{}{
 				{
-					db.Recursive{nil, &db.Times{time.Unix(123456789, 42244224), time.Duration(1337)}, map[db.Array2String]db.Recursive{
-						db.Array2String{"a", "棎鶊鵱"}: db.Recursive{},
-						db.Array2String{"x", "y"}:   db.Recursive{vdl.ValueOf(db.CreditReport{Agency: db.CreditAgencyExperian, Report: db.AgencyReportExperianReport{db.ExperianCreditReport{db.ExperianRatingGood}}}), nil, nil},
-					}},
+					db.Recursive{
+						Any: nil,
+						Maybe: &db.Times{
+							Stamp:    time.Unix(123456789, 42244224),
+							Interval: time.Duration(1337),
+						},
+						Rec: map[db.Array2String]db.Recursive{
+							array2String("a", "棎鶊鵱"): db.Recursive{},
+							array2String("x", "y"): db.Recursive{
+								Any: vdl.ValueOf(db.CreditReport{
+									Agency: db.CreditAgencyExperian,
+									Report: db.AgencyReportExperianReport{Value: db.ExperianCreditReport{Rating: db.ExperianRatingGood}},
+								}),
+								Maybe: nil,
+								Rec:   nil,
+							},
+						}},
 				},
 			},
 			`