From 0271adfae1c98048c7ff0e51fb3f2b82b7f65f5e Mon Sep 17 00:00:00 2001 From: Krishnan Govindraj Date: Thu, 6 Nov 2025 12:37:19 +0100 Subject: [PATCH 1/3] Introduce analyze options --- proto/BUILD | 1 + proto/analyze.proto | 4 +++- proto/options.proto | 4 ++++ 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/proto/BUILD b/proto/BUILD index 7c801385..afb5ff6d 100644 --- a/proto/BUILD +++ b/proto/BUILD @@ -111,6 +111,7 @@ proto_library( ":analyzed-conjunction-proto", ":concept-proto", ":error-proto", + ":options-proto", ], ) diff --git a/proto/analyze.proto b/proto/analyze.proto index 947ec6b8..7e3eb921 100644 --- a/proto/analyze.proto +++ b/proto/analyze.proto @@ -7,13 +7,15 @@ syntax = "proto3"; import "proto/analyzed-conjunction.proto"; import "proto/concept.proto"; import "proto/error.proto"; +import "proto/options.proto"; package typedb.protocol; message Analyze { message Req { - string query = 1; + Options.Analyze options = 1; + string query = 2; } message Res { diff --git a/proto/options.proto b/proto/options.proto index 6c394ed9..11cbf1b2 100644 --- a/proto/options.proto +++ b/proto/options.proto @@ -17,4 +17,8 @@ message Options { optional bool include_instance_types = 1; optional uint64 prefetch_size = 2; } + + message Analyze { + optional bool include_plan = 1; + } } From e86f1796003de2ca5bb7ebf646975fc7ff101f33 Mon Sep 17 00:00:00 2001 From: Krishnan Govindraj Date: Thu, 6 Nov 2025 13:17:29 +0100 Subject: [PATCH 2/3] Make involved_blocks optional --- proto/answer.proto | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/proto/answer.proto b/proto/answer.proto index 0ca455eb..91d48174 100644 --- a/proto/answer.proto +++ b/proto/answer.proto @@ -10,7 +10,7 @@ package typedb.protocol; message ConceptRow { repeated RowEntry row = 1; - bytes involved_blocks = 2; + optional bytes involved_blocks = 2; } message RowEntry { From 9efee414f821a8c62912fee17f416b8b3490c0cb Mon Sep 17 00:00:00 2001 From: Krishnan Govindraj Date: Fri, 7 Nov 2025 15:32:59 +0100 Subject: [PATCH 3/3] Add optional query structure to concept row --- proto/BUILD | 1 + proto/options.proto | 1 + proto/query.proto | 2 ++ 3 files changed, 4 insertions(+) diff --git a/proto/BUILD b/proto/BUILD index afb5ff6d..1eaa241b 100644 --- a/proto/BUILD +++ b/proto/BUILD @@ -79,6 +79,7 @@ proto_library( name = "query-proto", srcs = ["query.proto"], deps = [ + ":analyze-proto", ":answer-proto", ":concept-proto", ":error-proto", diff --git a/proto/options.proto b/proto/options.proto index 11cbf1b2..01df8b1b 100644 --- a/proto/options.proto +++ b/proto/options.proto @@ -16,6 +16,7 @@ message Options { message Query { optional bool include_instance_types = 1; optional uint64 prefetch_size = 2; + optional bool include_query_structure = 3; } message Analyze { diff --git a/proto/query.proto b/proto/query.proto index efb9940b..8fd640b1 100644 --- a/proto/query.proto +++ b/proto/query.proto @@ -4,6 +4,7 @@ syntax = "proto3"; +import "proto/analyze.proto"; import "proto/answer.proto"; import "proto/options.proto"; import "proto/error.proto"; @@ -51,6 +52,7 @@ message Query { // TODO: network optimisation: replace types (== mostly constant strings) with a IDs, sending types in the header to rebuild on the client side repeated string column_variable_names = 1; Type query_type = 2; + optional Analyze.Res.AnalyzedQuery.Pipeline query_structure = 3; } } }