2021-08-18 22:19:14 +00:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <Parsers/ASTBackupQuery.h>
|
|
|
|
|
|
|
|
|
|
|
|
namespace DB
|
|
|
|
{
|
|
|
|
class IBackup;
|
|
|
|
using BackupMutablePtr = std::shared_ptr<IBackup>;
|
|
|
|
class IBackupEntry;
|
|
|
|
using BackupEntryPtr = std::unique_ptr<IBackupEntry>;
|
|
|
|
using BackupEntries = std::vector<std::pair<String, BackupEntryPtr>>;
|
|
|
|
class Context;
|
|
|
|
using ContextPtr = std::shared_ptr<const Context>;
|
|
|
|
|
|
|
|
/// Prepares backup entries.
|
|
|
|
BackupEntries makeBackupEntries(const ASTBackupQuery::Elements & elements, const ContextPtr & context);
|
|
|
|
|
|
|
|
/// Write backup entries to an opened backup.
|
|
|
|
void writeBackupEntries(BackupMutablePtr backup, BackupEntries && backup_entries, size_t num_threads);
|
|
|
|
|
2022-01-17 18:55:40 +00:00
|
|
|
/// Returns the path to metadata in backup.
|
|
|
|
String getMetadataPathInBackup(const DatabaseAndTableName & table_name);
|
|
|
|
String getMetadataPathInBackup(const String & database_name);
|
|
|
|
String getMetadataPathInBackup(const IAST & create_query);
|
2021-08-18 22:19:14 +00:00
|
|
|
|
2022-01-17 18:55:40 +00:00
|
|
|
/// Returns the path to table's data in backup.
|
|
|
|
String getDataPathInBackup(const DatabaseAndTableName & table_name);
|
|
|
|
String getDataPathInBackup(const IAST & create_query);
|
2021-08-18 22:19:14 +00:00
|
|
|
|
|
|
|
}
|