Skip to content

Commit 77d166f

Browse files
authored
Rework transaction options (#221)
## Release notes: usage and product changes Reintroduce transaction options available in TypeDB 3.x. Introduce query options for query-specific configuration. Remove unused Logic-related messages. ## Implementation Replace the general `Options` message with `Options.Transaction` and `Options.Query`. Both options are mandatory, but their fields are optional, so the parsing of these messages is straightforward, similar to the 2.x protocol. Only the options declared in the server's code are introduced.
1 parent 195a37a commit 77d166f

File tree

10 files changed

+14
-131
lines changed

10 files changed

+14
-131
lines changed

grpc/java/BUILD

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ java_grpc_library(
1717
"//proto:concept-proto",
1818
"//proto:connection-proto",
1919
"//proto:authentication-proto",
20-
"//proto:logic-proto",
2120
"//proto:options-proto",
2221
"//proto:query-proto",
2322
"//proto:transaction-proto",

grpc/nodejs/BUILD

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@ ts_grpc_compile(
3333
"//proto:concept-proto",
3434
"//proto:connection-proto",
3535
"//proto:authentication-proto",
36-
"//proto:logic-proto",
3736
"//proto:options-proto",
3837
"//proto:query-proto",
3938
"//proto:transaction-proto",

grpc/rust/BUILD

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ rust_tonic_compile(
2020
"//proto:concept-proto",
2121
"//proto:connection-proto",
2222
"//proto:authentication-proto",
23-
"//proto:logic-proto",
2423
"//proto:options-proto",
2524
"//proto:query-proto",
2625
"//proto:transaction-proto",

grpc/rust/build.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ fn main() -> std::io::Result<()> {
99
"../../proto/concept.proto",
1010
"../../proto/connection.proto",
1111
"../../proto/database.proto",
12-
"../../proto/logic.proto",
1312
"../../proto/options.proto",
1413
"../../proto/query.proto",
1514
"../../proto/server.proto",

proto/BUILD

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -60,12 +60,6 @@ proto_library(
6060
],
6161
)
6262

63-
proto_library(
64-
name = "logic-proto",
65-
srcs = ["logic.proto"],
66-
deps = [":answer-proto"]
67-
)
68-
6963
proto_library(
7064
name = "options-proto",
7165
srcs = ["options.proto"],
@@ -76,7 +70,6 @@ proto_library(
7670
srcs = ["query.proto"],
7771
deps = [
7872
":answer-proto",
79-
":logic-proto",
8073
":options-proto",
8174
":concept-proto",
8275
],
@@ -88,7 +81,6 @@ proto_library(
8881
deps = [
8982
":answer-proto",
9083
":concept-proto",
91-
":logic-proto",
9284
":options-proto",
9385
":query-proto",
9486
]
@@ -111,7 +103,6 @@ filegroup(
111103
"options.proto",
112104
"query.proto",
113105
"transaction.proto",
114-
"logic.proto",
115106
"version.proto",
116107
]
117108
)

proto/logic.proto

Lines changed: 0 additions & 103 deletions
This file was deleted.

proto/options.proto

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,14 @@ syntax = "proto3";
77
package typedb.protocol;
88

99
message Options {
10-
// optional bool infer = 1;
11-
// optional bool trace_inference = 2;
12-
// optional bool explain = 3;
13-
optional bool parallel = 4;
14-
optional uint64 prefetch_size = 5;
15-
optional bool prefetch = 6;
16-
// optional int32 session_idle_timeout_millis = 7;
17-
optional uint64 transaction_timeout_millis = 8;
18-
optional uint64 schema_lock_acquire_timeout_millis = 9;
19-
optional bool read_any_replica = 10;
10+
message Transaction {
11+
optional bool parallel = 1;
12+
optional uint64 transaction_timeout_millis = 2;
13+
optional uint64 schema_lock_acquire_timeout_millis = 3;
14+
}
15+
16+
message Query {
17+
optional bool include_instance_types = 1;
18+
optional uint64 prefetch_size = 2;
19+
}
2020
}

proto/query.proto

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ message Query {
1818
}
1919

2020
message Req {
21-
Options options = 1;
21+
Options.Query options = 1;
2222
string query = 2;
2323
}
2424

proto/transaction.proto

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44

55
syntax = "proto3";
66

7-
//import "proto/logic.proto";
87
import "proto/options.proto";
98
import "proto/query.proto";
109

@@ -64,7 +63,7 @@ message Transaction {
6463
message Req {
6564
string database = 1;
6665
Type type = 2;
67-
Options options = 3;
66+
Options.Transaction options = 3;
6867
uint64 network_latency_millis = 4;
6968
}
7069
message Res {

proto/version.proto

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ syntax = "proto3";
77
package typedb.protocol;
88

99
enum Version {
10-
reserved 1, 2, 3, 4; // add past version numbers into the reserved range
10+
reserved 1, 2, 3, 4, 5; // add past version numbers into the reserved range
1111
UNSPECIFIED = 0;
12-
VERSION = 5;
12+
VERSION = 6;
1313
}

0 commit comments

Comments
 (0)