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;
68 constexpr explicit TransactionOptions(
Mode m) : mode{m} {}
70 bool IsReadOnly()
const {
return mode & kReadOnly; }
117 constexpr CommandControl(TimeoutDuration execute, TimeoutDuration statement)
118 : execute(execute), statement(statement) {}
120 constexpr CommandControl WithExecuteTimeout(TimeoutDuration n)
const
122 return {n, statement};
125 constexpr CommandControl WithStatementTimeout(TimeoutDuration s)
const
131 return execute == rhs.execute && statement == rhs.statement;
134 bool operator!=(
const CommandControl& rhs)
const {
return !(*
this == rhs); }
148OptionalCommandControl GetHandlerOptionalCommandControl(
149 const CommandControlByHandlerMap& map, std::string_view path,
150 std::string_view method);
152OptionalCommandControl GetQueryOptionalCommandControl(
153 const CommandControlByQueryMap& map,
const std::string& query_name);
215 enum PreparedStatementOptions {
216 kCachePreparedStatements,
217 kNoPreparedStatements,
219 enum UserTypesOptions {
222 kPredefinedTypesOnly,
224 enum CheckQueryParamsOptions {
228 enum DiscardOnConnectOptions {
232 using SettingsVersion = std::size_t;
266 return !RequiresConnectionReset(rhs) &&
271 return !(*
this == rhs);
276 return prepared_statements != rhs.prepared_statements ||
277 user_types != rhs.user_types ||
278 ignore_unused_query_params != rhs.ignore_unused_query_params ||
279 max_prepared_cache_size != rhs.max_prepared_cache_size ||
280 pipeline_mode != rhs.pipeline_mode || max_ttl != rhs.max_ttl ||
281 discard_on_connect != rhs.discard_on_connect ||
282 omit_describe_mode != rhs.omit_describe_mode;
289struct StatementMetricsSettings
final {
293 bool operator==(
const StatementMetricsSettings& other)
const {
304enum class ConnlimitMode {