1
1
#include " basic_example.h"
2
2
3
3
#include < src/util/folder/pathsplit.h>
4
+ #include < include/ydb-cpp-sdk/json_value/ydb_json_value.h>
4
5
5
6
#include < format>
6
7
@@ -82,7 +83,7 @@ static void CreateTables(TTableClient client, const std::string& path) {
82
83
}
83
84
84
85
// ! Describe existing table.
85
- static std::string DescribeTable (TTableClient client, const std::string& path, const std::string& name) {
86
+ static void DescribeTable (TTableClient client, const std::string& path, const std::string& name) {
86
87
std::optional<TTableDescription> desc;
87
88
std::string result;
88
89
ThrowOnError (client.RetryOperationSync ([path, name, &desc](TSession session) {
@@ -91,15 +92,13 @@ static std::string DescribeTable(TTableClient client, const std::string& path, c
91
92
if (result.IsSuccess ()) {
92
93
desc = result.GetTableDescription ();
93
94
}
94
-
95
95
return result;
96
96
}));
97
97
98
- result += std::format (" > Describe table: {}\n " , name);
98
+ std::cout << std::format (" > Describe table: {}\n " , name);
99
99
for (auto & column : desc->GetColumns ()) {
100
- result += std::format (" Column, name: {}, type: {}\n " , column.Name , FormatType (column.Type ));
100
+ std::cout << std::format (" Column, name: {}, type: {}\n " , column.Name , FormatType (column.Type ));
101
101
}
102
- return result;
103
102
}
104
103
105
104
// /////////////////////////////////////////////////////////////////////////////
@@ -439,7 +438,6 @@ std::string SelectSimple(TTableClient client, const std::string& path) {
439
438
ThrowOnError (client.RetryOperationSync ([path, &resultSet](TSession session) {
440
439
return SelectSimpleTransaction (session, path, resultSet);
441
440
}));
442
-
443
441
TResultSetParser parser (*resultSet);
444
442
if (parser.TryNextRow ()) {
445
443
return std::format (" > SelectSimple:\n Series, Id: {}, Title: {}, Release date: {}\n "
@@ -585,7 +583,7 @@ std::unique_ptr<Response> Run(const TDriver& driver, const std::string& path) {
585
583
try {
586
584
CreateTables (client, path);
587
585
588
- response-> result += DescribeTable (client, path, " series" );
586
+ DescribeTable (client, path, " series" );
589
587
590
588
ThrowOnError (client.RetryOperationSync ([path](TSession session) {
591
589
return FillTableDataTransaction (session, path);
0 commit comments