From 47667a3d28bb30056c5e883b938aef58532df725 Mon Sep 17 00:00:00 2001 From: Georgii Novoselov <22564079+farost@users.noreply.github.com> Date: Thu, 26 Sep 2024 12:56:57 +0100 Subject: [PATCH] Add Query::Type to ConceptRowStream (#209) ## Release notes: usage and product changes In 3.0, we no longer use parsers on our user-facing clients, and we no longer can differentiate the types of queries we are executing on the server. However, it can be sometimes useful (e.g. for extra logging/messaging) to have at least some information about the nature of the queries. For these purposes, we add the executed query's type to `ConceptRowStream`. ## Implementation For now, it's just general `Read/Write/Schema` (like transaction types), which is enough for our existing tasks. --- proto/query.proto | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/proto/query.proto b/proto/query.proto index 9fc0da9..5e3305c 100644 --- a/proto/query.proto +++ b/proto/query.proto @@ -12,6 +12,12 @@ package typedb.protocol; message Query { + enum Type { + READ = 0; + WRITE = 1; + SCHEMA = 2; + } + message Req { Options options = 1; string query = 2; @@ -36,10 +42,12 @@ message Query { message ReadableConceptTreeStream { // note: we could use this first response to record debug info, type annotations, warnings, etc + // TODO: Add Type query_type } message ConceptRowStream { repeated string column_variable_names = 1; + Type query_type = 2; } } }