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>
15#include <userver/utils/str_icase.hpp>
17USERVER_NAMESPACE_BEGIN
62 Mode mode = kReadWrite;
64 constexpr TransactionOptions() =
default;
67 constexpr explicit TransactionOptions(
Mode m) : mode{m} {}
69 bool IsReadOnly()
const {
return mode & kReadOnly; }
113 constexpr CommandControl(TimeoutDuration execute, TimeoutDuration statement)
114 : execute(execute), statement(statement) {}
116 constexpr CommandControl WithExecuteTimeout(TimeoutDuration n)
const noexcept {
return {n, statement}; }
118 constexpr CommandControl WithStatementTimeout(TimeoutDuration s)
const noexcept {
return {execute, s}; }
120 bool operator==(
const CommandControl& rhs)
const {
return execute == rhs.execute && statement == rhs.statement; }
122 bool operator!=(
const CommandControl& rhs)
const {
return !(*
this == rhs); }
133OptionalCommandControl
134GetHandlerOptionalCommandControl(
const CommandControlByHandlerMap& map, std::string_view path, std::string_view method);
136OptionalCommandControl
137GetQueryOptionalCommandControl(
const CommandControlByQueryMap& map,
const std::string& query_name);
206 enum PreparedStatementOptions {
207 kCachePreparedStatements,
208 kNoPreparedStatements,
210 enum UserTypesOptions {
213 kPredefinedTypesOnly,
215 enum CheckQueryParamsOptions {
219 enum DiscardOnConnectOptions {
223 using SettingsVersion = std::size_t;
263 return prepared_statements != rhs.prepared_statements || user_types != rhs.user_types ||
264 ignore_unused_query_params != rhs.ignore_unused_query_params ||
265 max_prepared_cache_size != rhs.max_prepared_cache_size || pipeline_mode != rhs.pipeline_mode ||
266 max_ttl != rhs.max_ttl || discard_on_connect != rhs.discard_on_connect ||
267 omit_describe_mode != rhs.omit_describe_mode;
274struct StatementMetricsSettings
final {
287enum class ConnlimitMode {