mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-12-01 20:12:02 +00:00
97f2a2213e
* Move some code outside dbms/src folder * Fix paths
31 lines
646 B
C++
31 lines
646 B
C++
#include <Parsers/ParserUseQuery.h>
|
|
#include <Parsers/ASTIdentifier.h>
|
|
#include <Parsers/ExpressionElementParsers.h>
|
|
#include <Parsers/CommonParsers.h>
|
|
#include <Parsers/ASTUseQuery.h>
|
|
|
|
|
|
namespace DB
|
|
{
|
|
|
|
bool ParserUseQuery::parseImpl(Pos & pos, ASTPtr & node, Expected & expected)
|
|
{
|
|
ParserKeyword s_use("USE");
|
|
ParserIdentifier name_p;
|
|
|
|
if (!s_use.ignore(pos, expected))
|
|
return false;
|
|
|
|
ASTPtr database;
|
|
if (!name_p.parse(pos, database, expected))
|
|
return false;
|
|
|
|
auto query = std::make_shared<ASTUseQuery>();
|
|
tryGetIdentifierNameInto(database, query->database);
|
|
node = query;
|
|
|
|
return true;
|
|
}
|
|
|
|
}
|