10#include <unordered_map>
12#include <userver/congestion_control/controllers/linear.hpp>
13#include <userver/storages/postgres/postgres_fwd.hpp>
14#include <userver/utils/impl/transparent_hash.hpp>
16USERVER_NAMESPACE_BEGIN
61 Mode mode = kReadWrite;
63 constexpr TransactionOptions() =
default;
66 constexpr explicit TransactionOptions(
Mode m) : mode{m} {}
68 bool IsReadOnly()
const {
return mode & kReadOnly; }
112 constexpr CommandControl(TimeoutDuration execute, TimeoutDuration statement)
113 : execute(execute), statement(statement) {}
115 constexpr CommandControl WithExecuteTimeout(TimeoutDuration n)
const noexcept {
return {n, statement}; }
117 constexpr CommandControl WithStatementTimeout(TimeoutDuration s)
const noexcept {
return {execute, s}; }
119 bool operator==(
const CommandControl& rhs)
const {
return execute == rhs.execute && statement == rhs.statement; }
121 bool operator!=(
const CommandControl& rhs)
const {
return !(*
this == rhs); }
132OptionalCommandControl
133GetHandlerOptionalCommandControl(
const CommandControlByHandlerMap& map, std::string_view path, std::string_view method);
135OptionalCommandControl
136GetQueryOptionalCommandControl(
const CommandControlByQueryMap& map,
const std::string& query_name);
197 enum PreparedStatementOptions {
198 kCachePreparedStatements,
199 kNoPreparedStatements,
201 enum UserTypesOptions {
204 kPredefinedTypesOnly,
206 enum CheckQueryParamsOptions {
210 enum DiscardOnConnectOptions {
214 using SettingsVersion = std::size_t;
254 return prepared_statements != rhs.prepared_statements || user_types != rhs.user_types ||
255 ignore_unused_query_params != rhs.ignore_unused_query_params ||
256 max_prepared_cache_size != rhs.max_prepared_cache_size || pipeline_mode != rhs.pipeline_mode ||
257 max_ttl != rhs.max_ttl || discard_on_connect != rhs.discard_on_connect ||
258 omit_describe_mode != rhs.omit_describe_mode;
265struct StatementMetricsSettings
final {
278enum class ConnlimitMode {