Skip to content

Commit f206389

Browse files
committed
Returned examples and tests
1 parent 8328262 commit f206389

File tree

536 files changed

+405
-44141
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

536 files changed

+405
-44141
lines changed

CMakeLists.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,13 +44,13 @@ add_subdirectory(src)
4444
add_subdirectory(util)
4545

4646
if (YDB_SDK_EXAMPLES)
47-
#add_subdirectory(examples)
47+
add_subdirectory(examples)
4848
endif()
4949

5050
if (YDB_SDK_TESTS)
5151
enable_testing()
52-
#add_subdirectory(tests/unit)
53-
#add_subdirectory(tests/integration)
52+
add_subdirectory(tests/unit)
53+
add_subdirectory(tests/integration)
5454
endif()
5555

5656
if (YDB_SDK_INSTALL)

examples/CMakeLists.txt

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,3 @@
1-
2-
# This file was generated by the build system used internally in the Yandex monorepo.
3-
# Only simple modifications are allowed (adding source-files to targets, adding simple properties
4-
# like target_include_directories). These modifications will be ported to original
5-
# ya.make files by maintainers. Any complex modifications which can't be ported back to the
6-
# original buildsystem will not be accepted.
7-
8-
91
add_subdirectory(basic_example)
102
add_subdirectory(bulk_upsert_simple)
113
add_subdirectory(pagination)

examples/basic_example/basic_example.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#include "basic_example.h"
22

3-
#include <ydb-cpp-sdk/util/string/cast.h>
3+
#include <util/string/cast.h>
44

55
#include <filesystem>
66
#include <format>
@@ -24,7 +24,7 @@ static void ThrowOnError(const TStatus& status) {
2424

2525
static void PrintStatus(const TStatus& status) {
2626
std::cerr << "Status: " << ToString(status.GetStatus()) << std::endl;
27-
status.GetIssues().PrintTo(std::cerr);
27+
std::cerr << status.GetIssues().ToString();
2828
}
2929

3030
static std::string JoinPath(const std::string& basePath, const std::string& path) {

examples/basic_example/main.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#include "basic_example.h"
22

3-
#include <src/library/getopt/last_getopt.h>
3+
#include <library/cpp/getopt/last_getopt.h>
44

55
#include <cstdlib>
66
#include <fstream>

examples/bulk_upsert_simple/main.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#include <ydb-cpp-sdk/client/table/table.h>
22

3-
#include <src/library/getopt/last_getopt.h>
3+
#include <library/cpp/getopt/last_getopt.h>
44

55
#include <filesystem>
66

@@ -53,7 +53,7 @@ bool WriteLogBatch(NYdb::NTable::TTableClient& tableClient, const std::string& t
5353
auto status = tableClient.RetryOperationSync(bulkUpsertOperation, retrySettings);
5454

5555
if (!status.IsSuccess()) {
56-
std::cerr << std::endl << "Write failed with status: " << (const NYdb::TStatus&)status << std::endl;
56+
std::cerr << std::endl << "Write failed with status: " << ToString(status) << std::endl;
5757
return false;
5858
}
5959
return true;
@@ -77,7 +77,7 @@ bool CreateLogTable(NYdb::NTable::TTableClient& client, const std::string& table
7777
}, settings);
7878

7979
if (!status.IsSuccess()) {
80-
std::cerr << "Create table failed with status: " << status << std::endl;
80+
std::cerr << "Create table failed with status: " << ToString(status) << std::endl;
8181
return false;
8282
}
8383
return true;

examples/pagination/main.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#include "pagination.h"
22

3-
#include <src/library/getopt/last_getopt.h>
3+
#include <library/cpp/getopt/last_getopt.h>
44

55
using namespace NLastGetopt;
66
using namespace NYdb;

examples/pagination/pagination.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#include "pagination.h"
22

3-
#include <ydb-cpp-sdk/util/string/cast.h>
3+
#include <util/string/cast.h>
44

55
#include <filesystem>
66

@@ -25,7 +25,7 @@ static void ThrowOnError(const TStatus& status) {
2525

2626
static void PrintStatus(const TStatus& status) {
2727
std::cerr << "Status: " << ToString(status.GetStatus()) << std::endl;
28-
status.GetIssues().PrintTo(std::cerr);
28+
std::cerr << status.GetIssues().ToString();
2929
}
3030

3131
static std::string JoinPath(const std::string& basePath, const std::string& path) {

examples/secondary_index/secondary_index.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
#include <ydb-cpp-sdk/client/driver/driver.h>
44
#include <ydb-cpp-sdk/client/table/table.h>
55

6-
#include <src/library/getopt/last_getopt.h>
6+
#include <library/cpp/getopt/last_getopt.h>
77

88
////////////////////////////////////////////////////////////////////////////////
99

@@ -49,7 +49,7 @@ class TYdbErrorException : public yexception {
4949
out << "Status: " << ToString(e.Status.GetStatus());
5050
if (e.Status.GetIssues()) {
5151
out << std::endl;
52-
e.Status.GetIssues().PrintTo(out);
52+
out << e.Status.GetIssues().ToString();
5353
}
5454
return out;
5555
}

examples/secondary_index/secondary_index_generate.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#include "secondary_index.h"
22

3-
#include <ydb-cpp-sdk/util/thread/pool.h>
3+
#include <util/thread/pool.h>
44

55
#include <random>
66

examples/secondary_index/secondary_index_list.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#include "secondary_index.h"
22

3-
#include <src/util/charset/utf8.h>
3+
#include <util/charset/utf8.h>
44

55
using namespace NLastGetopt;
66
using namespace NYdb;

0 commit comments

Comments
 (0)