| 1 | #pragma once | 
|---|---|
| 2 | |
| 3 | #include <Interpreters/IInterpreter.h> | 
| 4 | #include <Parsers/IAST_fwd.h> | 
| 5 | |
| 6 | |
| 7 | namespace DB | 
| 8 | { | 
| 9 | class Context; | 
| 10 | class ASTShowCreateAccessEntityQuery; | 
| 11 | |
| 12 | |
| 13 | /** Returns a single item containing a statement which could be used to create a specified role. | 
| 14 | */ | 
| 15 | class InterpreterShowCreateAccessEntityQuery : public IInterpreter | 
| 16 | { | 
| 17 | public: | 
| 18 | InterpreterShowCreateAccessEntityQuery(const ASTPtr & query_ptr_, const Context & context_) | 
| 19 | : query_ptr(query_ptr_), context(context_) {} | 
| 20 | |
| 21 | BlockIO execute() override; | 
| 22 | |
| 23 | bool ignoreQuota() const override { return true; } | 
| 24 | bool ignoreLimits() const override { return true; } | 
| 25 | |
| 26 | private: | 
| 27 | ASTPtr query_ptr; | 
| 28 | const Context & context; | 
| 29 | |
| 30 | BlockInputStreamPtr executeImpl(); | 
| 31 | ASTPtr getCreateQuery(const ASTShowCreateAccessEntityQuery & show_query) const; | 
| 32 | ASTPtr getCreateQuotaQuery(const ASTShowCreateAccessEntityQuery & show_query) const; | 
| 33 | ASTPtr getCreateRowPolicyQuery(const ASTShowCreateAccessEntityQuery & show_query) const; | 
| 34 | }; | 
| 35 | |
| 36 | |
| 37 | } | 
| 38 | 
