1#pragma once
2
3#include <Interpreters/IInterpreter.h>
4#include <Parsers/IAST_fwd.h>
5
6
7namespace DB
8{
9
10class Context;
11
12
13/** Check that table exists. Return single row with single column "result" of type UInt8 and value 0 or 1.
14 */
15class InterpreterExistsQuery : public IInterpreter
16{
17public:
18 InterpreterExistsQuery(const ASTPtr & query_ptr_, const Context & context_)
19 : query_ptr(query_ptr_), context(context_) {}
20
21 BlockIO execute() override;
22
23 static Block getSampleBlock();
24
25private:
26 ASTPtr query_ptr;
27 const Context & context;
28
29 BlockInputStreamPtr executeImpl();
30};
31
32
33}
34