MCPcopy Create free account
hub / github.com/ClickHouse/ClickHouse / DatabasePostgreSQL

Method DatabasePostgreSQL

src/Databases/PostgreSQL/DatabasePostgreSQL.cpp:55–83  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

53static const auto reschedule_error_multiplier = 10;
54
55DatabasePostgreSQL::DatabasePostgreSQL(
56 ContextPtr context_,
57 const String & metadata_path_,
58 const ASTStorage * database_engine_define_,
59 const String & dbname_,
60 const StoragePostgreSQL::Configuration & configuration_,
61 postgres::PoolWithFailoverPtr pool_,
62 bool cache_tables_,
63 UUID uuid)
64 : DatabaseWithAltersOnDiskBase(dbname_)
65 , WithContext(context_->getGlobalContext())
66 , metadata_path(metadata_path_)
67 , database_engine_define(database_engine_define_->clone())
68 , configuration(configuration_)
69 , pool(std::move(pool_))
70 , cache_tables(cache_tables_)
71 , log(getLogger("DatabasePostgreSQL(" + dbname_ + ")"))
72 , db_uuid(uuid)
73{
74 persistent = !context_->getClientInfo().is_shared_catalog_internal;
75 if (persistent)
76 {
77 auto db_disk = getDisk();
78 db_disk->createDirectories(metadata_path);
79 }
80
81 cleaner_task = getContext()->getSchedulePool().createTask(StorageID::createEmpty(), "PostgreSQLCleanerTask", [this]{ removeOutdatedTables(); });
82 cleaner_task->deactivate();
83}
84
85
86String DatabasePostgreSQL::getTableNameForLogs(const String & table_name) const

Callers

nothing calls this directly

Calls 8

createEmptyFunction · 0.85
getLoggerFunction · 0.50
getContextFunction · 0.50
getGlobalContextMethod · 0.45
cloneMethod · 0.45
createDirectoriesMethod · 0.45
createTaskMethod · 0.45
deactivateMethod · 0.45

Tested by

no test coverage detected