aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorshmel1k <shmel1k@ydb.tech>2022-08-11 16:14:02 +0300
committershmel1k <shmel1k@ydb.tech>2022-08-11 16:14:02 +0300
commit2ae40e59dfed06d040d323f66d89f567071180b3 (patch)
tree7268b7b013d6d21d8accf2541ee44a2ebd20a670
parentfe22e5c95f37c7ee46472d920d1dbf95f412b9e6 (diff)
downloadydb-2ae40e59dfed06d040d323f66d89f567071180b3.tar.gz
[] initial stream read & write
-rw-r--r--ydb/public/lib/ydb_cli/commands/ydb_service_scheme.cpp2
-rw-r--r--ydb/public/lib/ydb_cli/common/format.cpp19
-rw-r--r--ydb/public/lib/ydb_cli/common/formats.h12
3 files changed, 31 insertions, 2 deletions
diff --git a/ydb/public/lib/ydb_cli/commands/ydb_service_scheme.cpp b/ydb/public/lib/ydb_cli/commands/ydb_service_scheme.cpp
index a81537adad..ee8527eb48 100644
--- a/ydb/public/lib/ydb_cli/commands/ydb_service_scheme.cpp
+++ b/ydb/public/lib/ydb_cli/commands/ydb_service_scheme.cpp
@@ -198,7 +198,7 @@ namespace {
// .Column(4, rule.ServiceType())
// .Column(5, rule.Version());
}
- Cout << Endl << "ReadRules: " << Endl;
+ Cout << Endl << "Consumers: " << Endl;
Cout << table;
}
}
diff --git a/ydb/public/lib/ydb_cli/common/format.cpp b/ydb/public/lib/ydb_cli/common/format.cpp
index 39b01d6a01..4c2bff7c00 100644
--- a/ydb/public/lib/ydb_cli/common/format.cpp
+++ b/ydb/public/lib/ydb_cli/common/format.cpp
@@ -14,11 +14,18 @@ namespace {
{ EOutputFormat::JsonUnicode, "Input in json format, binary strings are decoded with unicode characters" },
{ EOutputFormat::JsonBase64, "Input in json format, binary strings are decoded with base64" },
{ EOutputFormat::Csv, "Input in csv format" },
- { EOutputFormat::Tsv, "Input in tsv format" }
+ { EOutputFormat::Tsv, "Input in tsv format" },
+ { EOutputFormat::SingleMessage, "Input data as a single message"}, // TODO
+ { EOutputFormat::NewlineDelimited, "Input data is '\\n' delimited"}, // TODO
+// { EOutputFormat::JsonRawStreamConcat, ""}, // TODO,
+// { EOutputFormat::JsonRawArray, ""}, // TODO
};
THashMap<EOutputFormat, TString> FormatDescriptions = {
{ EOutputFormat::Pretty, "Human readable output" },
+ { EOutputFormat::PrettyRaw, "Human readable format with raw data printed"}, // TODO(shmel1k@): improve
+ { EOutputFormat::PrettyUnicode, "Human readable format with data printed as unicode"}, // TODO(shmel1k@): improve
+ { EOutputFormat::PrettyBase64, "Human readable format with data printed as base64 encoded"}, // TODO(shmel1k@): improve
{ EOutputFormat::Json, "Output in json format" },
{ EOutputFormat::JsonUnicode, "Output in json format, binary strings are encoded with unicode characters. "
"Every row is a separate json on a separate line." },
@@ -30,8 +37,18 @@ namespace {
{ EOutputFormat::JsonBase64Array, "Output in json format, binary strings are encoded with base64. "
"Every resultset is a json array of rows. "
"Every row is a separate json on a separate line." },
+ { EOutputFormat::JsonRawArray, "Output in json format, binary strings are not encoded."
+ "Every resultset is a json array of rows. "
+ "Every row is a separate binary data on a separate line"},
{ EOutputFormat::ProtoJsonBase64, "Output result protobuf in json format, binary strings are encoded with base64" },
{ EOutputFormat::Csv, "Output in csv format" },
+ { EOutputFormat::SingleMessage, "Output result is presented as a single message"}, // TODO(shmel1k@): improve
+ { EOutputFormat::NewlineDelimited, "Newline delimited"}, // TODO(shmel1k@): improve
+ { EOutputFormat::NewlineBase64, "Newline base64"}, // TODO(shmel1k@): improve,
+ { EOutputFormat::Concatenated, "Concatenated"}, // TODO(shmel1k@): improve,
+ { EOutputFormat::JsonBase64StreamConcat, "Concatenated base64 stream"}, // TODO(shmel1k@): improve,
+ { EOutputFormat::JsonUnicodeStreamConcat, "Concatenated unicode stream"}, // TODO(shmel1k@): improve,
+ { EOutputFormat::JsonRawStreamConcat, "Concated raw stream"}, // TODO(shmel1k@): improve
};
}
diff --git a/ydb/public/lib/ydb_cli/common/formats.h b/ydb/public/lib/ydb_cli/common/formats.h
index 284d7f01d2..05fd8b6ba0 100644
--- a/ydb/public/lib/ydb_cli/common/formats.h
+++ b/ydb/public/lib/ydb_cli/common/formats.h
@@ -6,14 +6,26 @@ namespace NConsoleClient {
enum class EOutputFormat {
Default /* "default" */,
Pretty /* "pretty" */,
+ PrettyRaw /* "pretty-raw" */,
+ PrettyUnicode /* "pretty-unicode" */,
+ PrettyBase64 /* "pretty-base64" */,
Json /* "json" */,
JsonUnicode /* "json-unicode" */,
JsonUnicodeArray /* "json-unicode-array" */,
JsonBase64 /* "json-base64" */,
JsonBase64Array /* "json-base64-array" */,
+ JsonRawArray /* "json-raw-array" */,
ProtoJsonBase64 /* "proto-json-base64" */,
Csv /* "csv" */,
Tsv /* "tsv" */,
+ SingleMessage /* "single-message" */,
+ NewlineDelimited /* "newline-delimited" */,
+ NewlineBase64 /* "newline-base64" */,
+ Concatenated /* "concatenated" */,
+
+ JsonBase64StreamConcat /* "json-base64-stream-concat" */,
+ JsonUnicodeStreamConcat /* "json-unicode-stream-concat" */,
+ JsonRawStreamConcat /* "json-raw-stream-concat" */,
};
}