2021-08-18 22:19:14 +00:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <Parsers/IParserBase.h>
|
|
|
|
|
|
|
|
|
|
|
|
namespace DB
|
|
|
|
{
|
|
|
|
/** Parses queries like
|
|
|
|
* BACKUP { TABLE [db.]table_name [AS [db.]table_name_in_backup] [PARTITION[S] partition_expr [,...]] |
|
|
|
|
* DICTIONARY [db.]dictionary_name [AS [db.]dictionary_name_in_backup] |
|
2022-05-07 15:14:43 +00:00
|
|
|
* DATABASE database_name [AS database_name_in_backup] [EXCEPT TABLES ...] |
|
|
|
|
* TEMPORARY TABLE table_name [AS table_name_in_backup] |
|
2022-06-11 11:36:02 +00:00
|
|
|
* ALL [EXCEPT {TABLES|DATABASES}...] } [,...]
|
2022-05-07 15:14:43 +00:00
|
|
|
* [ON CLUSTER 'cluster_name']
|
2021-11-05 14:18:23 +00:00
|
|
|
* TO { File('path/') |
|
2022-07-02 16:26:08 +00:00
|
|
|
* Disk('disk_name', 'path/') }
|
|
|
|
* [SETTINGS ...]
|
2021-08-18 22:19:14 +00:00
|
|
|
*
|
2022-05-07 15:14:43 +00:00
|
|
|
* RESTORE { TABLE [db.]table_name_in_backup [AS [db.]table_name] [PARTITION[S] partition_expr [,...]] |
|
|
|
|
* DICTIONARY [db.]dictionary_name_in_backup [AS [db.]dictionary_name] |
|
|
|
|
* DATABASE database_name_in_backup [AS database_name] [EXCEPT TABLES ...] |
|
|
|
|
* TEMPORARY TABLE table_name_in_backup [AS table_name] |
|
2022-06-11 11:36:02 +00:00
|
|
|
* ALL [EXCEPT {TABLES|DATABASES} ...] } [,...]
|
2022-05-07 15:14:43 +00:00
|
|
|
* [ON CLUSTER 'cluster_name']
|
2022-07-02 16:26:08 +00:00
|
|
|
* FROM { File('path/') |
|
|
|
|
* Disk('disk_name', 'path/') }
|
|
|
|
* [SETTINGS ...]
|
2021-08-18 22:19:14 +00:00
|
|
|
*/
|
|
|
|
class ParserBackupQuery : public IParserBase
|
|
|
|
{
|
|
|
|
protected:
|
|
|
|
const char * getName() const override { return "BACKUP or RESTORE query"; }
|
|
|
|
bool parseImpl(Pos & pos, ASTPtr & node, Expected & expected) override;
|
|
|
|
};
|
|
|
|
}
|