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
148 std::chrono::milliseconds{500},
149 std::chrono::milliseconds{250}
153 Postgres(
const ComponentConfig&,
const ComponentContext&);
172 static yaml_config::Schema GetStaticConfigSchema();
175 void OnConfigUpdate(
const dynamic_config::Snapshot& cfg);
177 void OnSecdistUpdate(
const storages::
secdist::SecdistConfig& secdist);
180 std::string db_name_;
181 std::string dbalias_;
183 storages::
postgres::DatabasePtr database_;
187 concurrent::AsyncEventSubscriberScope config_subscription_;
188 concurrent::AsyncEventSubscriberScope secdist_subscription_;
189 utils::statistics::Entry statistics_holder_;
190 dynamic_config::Source config_source_;
194inline constexpr bool kHasValidate<Postgres> =
true;