8#include <userver/components/component_base.hpp>
9#include <userver/concurrent/async_event_source.hpp>
10#include <userver/dynamic_config/snapshot.hpp>
11#include <userver/engine/mutex.hpp>
12#include <userver/storages/secdist/secdist.hpp>
13#include <userver/utils/statistics/entry.hpp>
15#include <userver/storages/postgres/database.hpp>
17USERVER_NAMESPACE_BEGIN
129 std::chrono::milliseconds{500},
130 std::chrono::milliseconds{250}
134 Postgres(
const ComponentConfig&,
const ComponentContext&);
153 static yaml_config::Schema GetStaticConfigSchema();
156 void OnConfigUpdate(
const dynamic_config::Snapshot& cfg);
158 void OnSecdistUpdate(
const storages::
secdist::SecdistConfig& secdist);
161 std::string db_name_;
162 std::string dbalias_;
164 storages::
postgres::DatabasePtr database_;
168 concurrent::AsyncEventSubscriberScope config_subscription_;
169 concurrent::AsyncEventSubscriberScope secdist_subscription_;
170 utils::statistics::Entry statistics_holder_;
171 dynamic_config::Source config_source_;
175inline constexpr bool kHasValidate<Postgres> =
true;