2011-10-30 11:30:52 +00:00
|
|
|
#pragma once
|
|
|
|
|
2021-04-10 23:33:54 +00:00
|
|
|
#include <Interpreters/Context_fwd.h>
|
2021-09-01 19:42:49 +00:00
|
|
|
#include <Databases/TablesLoader.h>
|
2021-04-10 23:33:54 +00:00
|
|
|
|
2011-10-30 11:30:52 +00:00
|
|
|
|
|
|
|
namespace DB
|
|
|
|
{
|
|
|
|
|
2017-06-18 05:43:29 +00:00
|
|
|
/// Load tables from system database. Only real tables like query_log, part_log.
|
|
|
|
/// You should first load system database, then attach system tables that you need into it, then load other databases.
|
2021-05-31 14:49:02 +00:00
|
|
|
void loadMetadataSystem(ContextMutablePtr context);
|
2017-06-18 05:43:29 +00:00
|
|
|
|
2021-09-09 09:37:51 +00:00
|
|
|
/// Load tables from databases and add them to context. Database 'system' and 'information_schema' is ignored.
|
|
|
|
/// Use separate function to load system tables.
|
2021-05-31 14:49:02 +00:00
|
|
|
void loadMetadata(ContextMutablePtr context, const String & default_database_name = {});
|
2011-10-30 11:30:52 +00:00
|
|
|
|
2021-09-13 19:11:16 +00:00
|
|
|
/// Background operations in system tables may slowdown loading of the rest tables,
|
|
|
|
/// so we startup system tables after all databases are loaded.
|
2021-09-01 19:42:49 +00:00
|
|
|
void startupSystemTables();
|
|
|
|
|
2022-08-05 19:41:02 +00:00
|
|
|
/// Converts `system` database from Ordinary to Atomic (if needed)
|
|
|
|
void maybeConvertSystemDatabase(ContextMutablePtr context);
|
|
|
|
|
|
|
|
/// Converts all databases (except system) from Ordinary to Atomic if convert_ordinary_to_atomic flag exists
|
|
|
|
void convertDatabasesEnginesIfNeed(ContextMutablePtr context);
|
2022-06-23 19:38:43 +00:00
|
|
|
|
2011-10-30 11:30:52 +00:00
|
|
|
}
|