ClickHouse/src/Interpreters/InterpreterShowAccessQuery.h

34 lines
782 B
C++
Raw Normal View History

2020-06-10 23:08:37 +00:00
#pragma once
#include <Interpreters/IInterpreter.h>
#include <Parsers/IAST_fwd.h>
namespace DB
{
2020-06-10 23:08:37 +00:00
struct IAccessEntity;
using AccessEntityPtr = std::shared_ptr<const IAccessEntity>;
/** Return all queries for creating access entities and grants.
*/
class InterpreterShowAccessQuery : public IInterpreter, WithContext
2020-06-10 23:08:37 +00:00
{
public:
InterpreterShowAccessQuery(const ASTPtr & query_ptr_, ContextPtr context_) : WithContext(context_), query_ptr(query_ptr_) {}
2020-06-10 23:08:37 +00:00
BlockIO execute() override;
bool ignoreQuota() const override { return true; }
bool ignoreLimits() const override { return true; }
private:
2021-09-15 19:35:48 +00:00
QueryPipeline executeImpl() const;
2020-06-10 23:08:37 +00:00
ASTs getCreateAndGrantQueries() const;
std::vector<AccessEntityPtr> getEntities() const;
ASTPtr query_ptr;
};
}