Skip to content

Commit 8ba9a34

Browse files
Introduce Query.Options object and add explain option (#36)
## What is the goal of this PR? We introduce the Query `Options` message, which now contains `explain` flag on a query to ensure that the server knows when to cache explanations only when the user requests it. Using `oneof` as the optional syntax is adopted instead of using the NULL message, which will be removed elsewhere as well in the future. ## What are the changes implemented in this PR? * Add `explain` boolean option to `new Transaction.Query.Options`, that defaults to False * Add `Transaction.Query.Options` that now wraps the `infer` and `explain` boolean flags
1 parent 4ad2dfe commit 8ba9a34

File tree

1 file changed

+12
-7
lines changed

1 file changed

+12
-7
lines changed

session/Session.proto

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -143,18 +143,23 @@ message Transaction {
143143
message Iter {
144144
message Req {
145145
string query = 1;
146-
INFER infer = 2;
147-
// We cannot use bool for `infer` because GRPC's default value for bool is FALSE
148-
// We use enum INFER instead, because the default value is index 0 (TRUE)
146+
Transaction.Query.Options options = 2;
149147
}
150148
message Res {
151149
Answer answer = 1;
152150
}
153151
}
154-
enum INFER {
155-
TRUE = 0;
156-
FALSE = 1;
157-
// The default value of this enum is 0 (TRUE)
152+
153+
message Options {
154+
// optional infer flag
155+
oneof infer {
156+
bool inferFlag = 1;
157+
}
158+
159+
// optional explain flag
160+
oneof explain {
161+
bool explainFlag = 2;
162+
}
158163
}
159164
}
160165

0 commit comments

Comments
 (0)