2019-12-01 22:01:05 +00:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <Parsers/ASTQueryWithOutput.h>
|
2020-05-30 14:18:08 +00:00
|
|
|
#include <Access/IAccessEntity.h>
|
2019-12-01 22:01:05 +00:00
|
|
|
|
|
|
|
|
|
|
|
namespace DB
|
|
|
|
{
|
2020-05-30 14:18:08 +00:00
|
|
|
class ASTRowPolicyNames;
|
|
|
|
|
2020-09-15 09:55:57 +00:00
|
|
|
using Strings = std::vector<String>;
|
|
|
|
|
2020-06-06 07:21:02 +00:00
|
|
|
/** SHOW CREATE USER [name | CURRENT_USER]
|
|
|
|
* SHOW CREATE USERS [name [, name2 ...]
|
2020-03-18 14:11:44 +00:00
|
|
|
* SHOW CREATE ROLE name
|
2020-06-06 07:21:02 +00:00
|
|
|
* SHOW CREATE ROLES [name [, name2 ...]]
|
2020-03-18 14:11:44 +00:00
|
|
|
* SHOW CREATE [SETTINGS] PROFILE name
|
2020-06-06 07:21:02 +00:00
|
|
|
* SHOW CREATE [SETTINGS] PROFILES [name [, name2 ...]]
|
|
|
|
* SHOW CREATE [ROW] POLICY name ON [database.]table
|
|
|
|
* SHOW CREATE [ROW] POLICIES [name ON [database.]table [, name2 ON database2.table2 ...] | name | ON database.table]
|
|
|
|
* SHOW CREATE QUOTA [name]
|
|
|
|
* SHOW CREATE QUOTAS [name [, name2 ...]]
|
2019-12-01 22:01:05 +00:00
|
|
|
*/
|
|
|
|
class ASTShowCreateAccessEntityQuery : public ASTQueryWithOutput
|
|
|
|
{
|
|
|
|
public:
|
2020-05-03 03:12:03 +00:00
|
|
|
using EntityType = IAccessEntity::Type;
|
2020-02-04 22:37:04 +00:00
|
|
|
|
2020-05-03 03:12:03 +00:00
|
|
|
EntityType type;
|
2020-05-30 14:18:08 +00:00
|
|
|
Strings names;
|
2020-06-06 07:21:02 +00:00
|
|
|
std::shared_ptr<ASTRowPolicyNames> row_policy_names;
|
|
|
|
|
2019-12-01 22:01:05 +00:00
|
|
|
bool current_quota = false;
|
2020-02-04 22:37:04 +00:00
|
|
|
bool current_user = false;
|
2020-06-06 07:21:02 +00:00
|
|
|
bool all = false;
|
|
|
|
|
|
|
|
String short_name;
|
|
|
|
std::optional<std::pair<String, String>> database_and_table_name;
|
2019-12-01 22:01:05 +00:00
|
|
|
|
|
|
|
String getID(char) const override;
|
|
|
|
ASTPtr clone() const override;
|
|
|
|
|
2021-02-26 22:37:00 +00:00
|
|
|
void replaceEmptyDatabase(const String & current_database);
|
2020-05-30 14:18:08 +00:00
|
|
|
|
2019-12-01 22:01:05 +00:00
|
|
|
protected:
|
2020-06-06 07:21:02 +00:00
|
|
|
String getKeyword() const;
|
2019-12-01 22:01:05 +00:00
|
|
|
void formatQueryImpl(const FormatSettings & settings, FormatState &, FormatStateStacked) const override;
|
|
|
|
};
|
|
|
|
|
|
|
|
}
|