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
153 std::chrono::milliseconds{500},
154 std::chrono::milliseconds{250}
158 Postgres(
const ComponentConfig&,
const ComponentContext&);
177 static yaml_config::Schema GetStaticConfigSchema();
180 void OnConfigUpdate(
const dynamic_config::Snapshot& cfg);
182 void OnSecdistUpdate(
const storages::
secdist::SecdistConfig& secdist);
185 std::string db_name_;
186 std::string dbalias_;
188 storages::
postgres::DatabasePtr database_;
192 concurrent::AsyncEventSubscriberScope config_subscription_;
193 concurrent::AsyncEventSubscriberScope secdist_subscription_;
194 utils::statistics::Entry statistics_holder_;
195 dynamic_config::Source config_source_;
199inline constexpr bool kHasValidate<Postgres> =
true;