aboutsummaryrefslogtreecommitdiffstats
path: root/contrib/clickhouse/src/Functions/UserDefined/UserDefinedSQLObjectsBackup.h
blob: a1e970d8af517648f3e22d2a97abc3d8b0d1978a (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#pragma once

#include <Parsers/IAST_fwd.h>
#include <base/types.h>


namespace DB
{
class BackupEntriesCollector;
class RestorerFromBackup;
enum class UserDefinedSQLObjectType;
class IBackupEntry;
using BackupEntryPtr = std::shared_ptr<const IBackupEntry>;

/// Makes backup entries to backup user-defined SQL objects.
void backupUserDefinedSQLObjects(
    BackupEntriesCollector & backup_entries_collector,
    const String & data_path_in_backup,
    UserDefinedSQLObjectType object_type,
    const std::vector<std::pair<String, ASTPtr>> & objects);

/// Restores user-defined SQL objects from the backup.
std::vector<std::pair<String, ASTPtr>>
restoreUserDefinedSQLObjects(RestorerFromBackup & restorer, const String & data_path_in_backup, UserDefinedSQLObjectType object_type);
}