Skip to content

YDB C++ SDK Import 5 #387

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 7 commits into from
Mar 11, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions include/ydb-cpp-sdk/client/draft/ydb_replication.h
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ class TReplicationDescription {
};

class TDescribeReplicationResult: public NScheme::TDescribePathResult {
friend class NYdb::V3::TProtoAccessor;
friend class NYdb::TProtoAccessor;
const Ydb::Replication::DescribeReplicationResult& GetProto() const;

public:
Expand All @@ -188,4 +188,4 @@ class TReplicationClient {
std::shared_ptr<TImpl> Impl_;
};

} // namespace NYdb::V3::NReplication
} // namespace NYdb::NReplication
4 changes: 2 additions & 2 deletions include/ydb-cpp-sdk/client/draft/ydb_view.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ class TViewDescription {
};

class TDescribeViewResult : public NScheme::TDescribePathResult {
friend class NYdb::V3::TProtoAccessor;
friend class NYdb::TProtoAccessor;
const Ydb::View::DescribeViewResult& GetProto() const;

public:
Expand All @@ -55,4 +55,4 @@ class TViewClient {
std::shared_ptr<TImpl> Impl_;
};

} // namespace NYdb::V3::NView
} // namespace NYdb::NView
2 changes: 1 addition & 1 deletion include/ydb-cpp-sdk/client/driver/driver.h
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ class TDriverConfig {
//! default: 0
TDriverConfig& SetMaxClientQueueSize(size_t sz);
//! Enable Ssl.
//! caCerts - The buffer containing the PEM encoding of the server root certificates.
//! caCerts - The buffer containing the PEM encoded root certificates for SSL/TLS connections.
//! If this parameter is empty, the default roots will be used.
TDriverConfig& UseSecureConnection(const std::string& caCerts = std::string());
TDriverConfig& UseClientCertificate(const std::string& clientCert, const std::string& clientPrivateKey);
Expand Down
2 changes: 1 addition & 1 deletion include/ydb-cpp-sdk/client/monitoring/monitoring.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ struct TSelfCheckSettings : public TOperationRequestSettings<TSelfCheckSettings>
};

class TSelfCheckResult : public TStatus {
friend class NYdb::V3::TProtoAccessor;
friend class NYdb::TProtoAccessor;
public:
TSelfCheckResult(TStatus&& status, Ydb::Monitoring::SelfCheckResult&& result);
private:
Expand Down
2 changes: 1 addition & 1 deletion include/ydb-cpp-sdk/client/params/params.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ class TParams {
friend class NExperimental::TStreamQueryClient;
friend class NQuery::TExecQueryImpl;
friend class NQuery::TQueryClient;
friend class NYdb::V3::TProtoAccessor;
friend class NYdb::TProtoAccessor;
public:
bool Empty() const;

Expand Down
2 changes: 1 addition & 1 deletion include/ydb-cpp-sdk/client/query/client.h
Original file line number Diff line number Diff line change
Expand Up @@ -267,4 +267,4 @@ class TExecuteQueryResult : public TStatus {
std::optional<TTransaction> Transaction_;
};

} // namespace NYdb::V3::NQuery
} // namespace NYdb::NQuery
2 changes: 1 addition & 1 deletion include/ydb-cpp-sdk/client/query/query.h
Original file line number Diff line number Diff line change
Expand Up @@ -185,4 +185,4 @@ class TFetchScriptResultsResult : public TStatus {
using TAsyncFetchScriptResultsResult = NThreading::TFuture<TFetchScriptResultsResult>;
using TAsyncExecuteQueryResult = NThreading::TFuture<TExecuteQueryResult>;

} // namespace NYdb::V3::NQuery
} // namespace NYdb::NQuery
4 changes: 2 additions & 2 deletions include/ydb-cpp-sdk/client/query/stats.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ namespace NYdb::inline V3 {
namespace NYdb::inline V3::NQuery {

class TExecStats {
friend class NYdb::V3::TProtoAccessor;
friend class NYdb::TProtoAccessor;

public:
TExecStats() = default;
Expand All @@ -42,4 +42,4 @@ class TExecStats {
std::shared_ptr<TImpl> Impl_;
};

} // namespace NYdb::V3::NQuery
} // namespace NYdb::NQuery
2 changes: 1 addition & 1 deletion include/ydb-cpp-sdk/client/query/tx.h
Original file line number Diff line number Diff line change
Expand Up @@ -116,4 +116,4 @@ struct TTxControl {
: TxSettings_(txSettings) {}
};

} // namespace NYdb::V3::NQuery
} // namespace NYdb::NQuery
2 changes: 1 addition & 1 deletion include/ydb-cpp-sdk/client/rate_limiter/rate_limiter.h
Original file line number Diff line number Diff line change
Expand Up @@ -320,4 +320,4 @@ class TRateLimiterClient {
std::shared_ptr<TImpl> Impl_;
};

} // namespace NYdb::V3::NRateLimiter
} // namespace NYdb::NRateLimiter
2 changes: 1 addition & 1 deletion include/ydb-cpp-sdk/client/result/result.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ bool operator!=(const TColumn& col1, const TColumn& col2);
//! Collection of rows, represents result of query or part of the result in case of stream operations
class TResultSet {
friend class TResultSetParser;
friend class NYdb::V3::TProtoAccessor;
friend class NYdb::TProtoAccessor;
public:
TResultSet(const Ydb::ResultSet& proto);
TResultSet(Ydb::ResultSet&& proto);
Expand Down
2 changes: 1 addition & 1 deletion include/ydb-cpp-sdk/client/retry/retry.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,4 +41,4 @@ struct TRetryOperationSettings {
}
};

} // namespace NYdb::V3::NRetry
} // namespace NYdb::NRetry
14 changes: 7 additions & 7 deletions include/ydb-cpp-sdk/client/table/table.h
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,7 @@ struct TKMeansTreeSettings {

//! Represents index description
class TIndexDescription {
friend class NYdb::V3::TProtoAccessor;
friend class NYdb::TProtoAccessor;

public:
TIndexDescription(
Expand Down Expand Up @@ -349,7 +349,7 @@ class TBuildIndexOperation : public TOperation {

//! Represents changefeed description
class TChangefeedDescription {
friend class NYdb::V3::TProtoAccessor;
friend class NYdb::TProtoAccessor;

public:
class TInitialScanProgress {
Expand Down Expand Up @@ -655,7 +655,7 @@ enum class EStoreType {
//! Represents table description
class TTableDescription {
friend class TTableBuilder;
friend class NYdb::V3::TProtoAccessor;
friend class NYdb::TProtoAccessor;

using EUnit = TValueSinceUnixEpochModeSettings::EUnit;

Expand Down Expand Up @@ -1092,8 +1092,8 @@ using TAsyncScanQueryPartIterator = NThreading::TFuture<TScanQueryPartIterator>;

struct TCreateSessionSettings : public TOperationRequestSettings<TCreateSessionSettings> {};

using TBackoffSettings = NYdb::V3::NRetry::TBackoffSettings;
using TRetryOperationSettings = NYdb::V3::NRetry::TRetryOperationSettings;
using TBackoffSettings = NYdb::NRetry::TBackoffSettings;
using TRetryOperationSettings = NYdb::NRetry::TRetryOperationSettings;

struct TSessionPoolSettings {
using TSelf = TSessionPoolSettings;
Expand Down Expand Up @@ -2221,7 +2221,7 @@ class TExternalDataSourceDescription {
class TImpl;
std::shared_ptr<TImpl> Impl_;

friend class NYdb::V3::TProtoAccessor;
friend class NYdb::TProtoAccessor;
const Ydb::Table::DescribeExternalDataSourceResult& GetProto() const;
};

Expand All @@ -2247,7 +2247,7 @@ class TExternalTableDescription {
class TImpl;
std::shared_ptr<TImpl> Impl_;

friend class NYdb::V3::TProtoAccessor;
friend class NYdb::TProtoAccessor;
const Ydb::Table::DescribeExternalTableResult& GetProto() const;
};

Expand Down
2 changes: 1 addition & 1 deletion include/ydb-cpp-sdk/client/topic/client.h
Original file line number Diff line number Diff line change
Expand Up @@ -61,4 +61,4 @@ class TTopicClient {
std::shared_ptr<TImpl> Impl_;
};

} // namespace NYdb::V3::NTopic
} // namespace NYdb::NTopic
2 changes: 1 addition & 1 deletion include/ydb-cpp-sdk/client/topic/codecs.h
Original file line number Diff line number Diff line change
Expand Up @@ -93,4 +93,4 @@ class TCodecMap {
TAdaptiveLock Lock;
};

} // namespace NYdb::V3::NTopic
} // namespace NYdb::NTopic
14 changes: 7 additions & 7 deletions include/ydb-cpp-sdk/client/topic/control_plane.h
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,7 @@ struct TAlterPartitioningSettings {
};

class TTopicDescription {
friend class NYdb::V3::TProtoAccessor;
friend class NYdb::TProtoAccessor;

public:
TTopicDescription(Ydb::Topic::DescribeTopicResult&& desc);
Expand Down Expand Up @@ -330,7 +330,7 @@ class TTopicDescription {
};

class TConsumerDescription {
friend class NYdb::V3::TProtoAccessor;
friend class NYdb::TProtoAccessor;

public:
TConsumerDescription(Ydb::Topic::DescribeConsumerResult&& desc);
Expand All @@ -350,7 +350,7 @@ class TConsumerDescription {
};

class TPartitionDescription {
friend class NYdb::V3::TProtoAccessor;
friend class NYdb::TProtoAccessor;

public:
TPartitionDescription(Ydb::Topic::DescribePartitionResult&& desc);
Expand All @@ -365,7 +365,7 @@ class TPartitionDescription {

// Result for describe topic request.
struct TDescribeTopicResult : public TStatus {
friend class NYdb::V3::TProtoAccessor;
friend class NYdb::TProtoAccessor;

TDescribeTopicResult(TStatus&& status, Ydb::Topic::DescribeTopicResult&& result);

Expand All @@ -377,7 +377,7 @@ struct TDescribeTopicResult : public TStatus {

// Result for describe consumer request.
struct TDescribeConsumerResult : public TStatus {
friend class NYdb::V3::TProtoAccessor;
friend class NYdb::TProtoAccessor;

TDescribeConsumerResult(TStatus&& status, Ydb::Topic::DescribeConsumerResult&& result);

Expand All @@ -389,7 +389,7 @@ struct TDescribeConsumerResult : public TStatus {

// Result for describe partition request.
struct TDescribePartitionResult: public TStatus {
friend class NYdb::V3::TProtoAccessor;
friend class NYdb::TProtoAccessor;

TDescribePartitionResult(TStatus&& status, Ydb::Topic::DescribePartitionResult&& result);

Expand Down Expand Up @@ -768,4 +768,4 @@ struct TDescribePartitionSettings: public TOperationRequestSettings<TDescribePar
// Settings for commit offset request.
struct TCommitOffsetSettings : public TOperationRequestSettings<TCommitOffsetSettings> {};

} // namespace NYdb::V3::NTopic
} // namespace NYdb::NTopic
2 changes: 1 addition & 1 deletion include/ydb-cpp-sdk/client/topic/counters.h
Original file line number Diff line number Diff line change
Expand Up @@ -169,4 +169,4 @@ inline bool HasNullCounters(TReaderCounters& counters) {

#undef TOPIC_COUNTERS_HISTOGRAM_SETUP

} // namespace NYdb::V3::NTopic
} // namespace NYdb::NTopic
2 changes: 1 addition & 1 deletion include/ydb-cpp-sdk/client/topic/errors.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ namespace NYdb::inline V3::NTopic {
ERetryErrorClass GetRetryErrorClass(EStatus status);
ERetryErrorClass GetRetryErrorClassV2(EStatus status);

} // namespace NYdb::V3::NTopic
} // namespace NYdb::NTopic
2 changes: 1 addition & 1 deletion include/ydb-cpp-sdk/client/topic/retry_policy.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,4 +38,4 @@ struct IRetryPolicy: ::IRetryPolicy<EStatus> {
std::function<ERetryErrorClass(EStatus)> customRetryClassFunction = {});
};

} // namespace NYdb::V3::NTopic
} // namespace NYdb::NTopic
8 changes: 6 additions & 2 deletions include/ydb-cpp-sdk/library/issue/yql_issue.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,9 @@
#include <string>
#include <string_view>

namespace NYdb::NIssue {
namespace NYdb {
inline namespace V3 {
namespace NIssue {

using TIssueCode = uint32_t;
constexpr TIssueCode DEFAULT_ERROR = 0;
Expand Down Expand Up @@ -329,7 +331,9 @@ class TErrorException : public yexception {
TIssue ExceptionToIssue(const std::exception& e, const TPosition& pos = TPosition());
std::optional<TPosition> TryParseTerminationMessage(std::string_view& message);

} // namespace NYql
}
}
}

template <>
void Out<NYdb::NIssue::TPosition>(IOutputStream& out, const NYdb::NIssue::TPosition& pos);
Expand Down
4 changes: 3 additions & 1 deletion include/ydb-cpp-sdk/library/jwt/jwt.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
#include <util/datetime/base.h>

namespace NYdb {
inline namespace V3 {

struct TJwtParams {
std::string PrivKey;
Expand All @@ -17,4 +18,5 @@ std::string MakeSignedJwt(
const TDuration& lifetime = TDuration::Hours(1)
);

} // namespace NYdb
}
}
6 changes: 4 additions & 2 deletions include/ydb-cpp-sdk/library/operation_id/operation_id.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ namespace Ydb {
}

namespace NKikimr {
inline namespace V3 {
namespace NOperationId {

class TOperationId {
Expand Down Expand Up @@ -69,5 +70,6 @@ TOperationId::EKind ParseKind(const std::string_view value);
std::string FormatPreparedQueryIdCompat(const std::string& str);
bool DecodePreparedQueryIdCompat(const std::string& in, std::string& out);

} // namespace NOperationId
} // namespace NKikimr
}
}
}
6 changes: 5 additions & 1 deletion include/ydb-cpp-sdk/library/string_utils/helpers/helpers.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

#include <string>

namespace NYdb {
inline namespace V3 {
namespace NUtils {

char* ToLower(char* str) noexcept(noexcept(std::tolower(0)));
Expand Down Expand Up @@ -80,4 +82,6 @@ std::string Join(const R&... r) {
template <typename TChar>
std::basic_string<TChar> FromAscii(const std::string_view& s);

} // namespace NUtils
}
}
}
4 changes: 4 additions & 0 deletions include/ydb-cpp-sdk/library/string_utils/misc/misc.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@

#include <optional>

namespace NYdb {
inline namespace V3 {
namespace NUtils {

template <class TContainer, class T>
Expand Down Expand Up @@ -58,4 +60,6 @@ void GetNext(std::string_view& s, D delim, std::optional<std::string_view>& para
}
}

}
}
}
14 changes: 4 additions & 10 deletions include/ydb-cpp-sdk/type_switcher.h
Original file line number Diff line number Diff line change
@@ -1,17 +1,11 @@
#pragma once

#ifdef YDB_SDK_USE_STD_STRING

#include <string>

namespace NYdb {
using TStringType = std::string;
}
inline namespace Dev {

#else
using TStringType = std::string;

#include <util/generic/string.h>
namespace NYdb {
using TStringType = TString;
}

#endif
}
4 changes: 4 additions & 0 deletions src/api/protos/ydb_cms.proto
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,10 @@ message DatabaseOptions {
bool disable_external_subdomain = 2;
// Transaction plan resolution in milliseconds
uint32 plan_resolution = 3;
// Number of coordinators (server default is used when zero)
uint32 coordinators = 4;
// Number of mediators (server default is used when zero)
uint32 mediators = 5;
}

// A set of quotas for schema operations
Expand Down
2 changes: 1 addition & 1 deletion src/client/draft/ydb_dynamic_config.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -464,4 +464,4 @@ TAsyncFetchStartupConfigResult TDynamicConfigClient::FetchStartupConfig(const TC
return Impl_->FetchStartupConfig(settings);
}

} // namespace NYdb::V3::NDynamicConfig
} // namespace NYdb::NDynamicConfig
2 changes: 1 addition & 1 deletion src/client/federated_topic/impl/federated_read_session.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -288,4 +288,4 @@ bool TFederatedReadSessionImpl::Close(TDuration timeout) {
return result;
}

} // namespace NYdb::V3::NFederatedTopic
} // namespace NYdb::NFederatedTopic
2 changes: 1 addition & 1 deletion src/client/federated_topic/impl/federated_read_session.h
Original file line number Diff line number Diff line change
Expand Up @@ -246,4 +246,4 @@ class TFederatedReadSession : public IFederatedReadSession,
}
};

} // namespace NYdb::V3::NFederatedTopic
} // namespace NYdb::NFederatedTopic
Loading
Loading