mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-12-02 04:22:03 +00:00
30 lines
663 B
C++
30 lines
663 B
C++
#include <Parsers/ParserDatabaseOrNone.h>
|
|
#include <Parsers/parseIdentifierOrStringLiteral.h>
|
|
#include <Parsers/ASTDatabaseOrNone.h>
|
|
#include <Parsers/CommonParsers.h>
|
|
|
|
namespace DB
|
|
{
|
|
bool ParserDatabaseOrNone::parseImpl(Pos & pos, ASTPtr & node, Expected & expected)
|
|
{
|
|
auto result = std::make_shared<ASTDatabaseOrNone>();
|
|
node = result;
|
|
|
|
if (ParserKeyword{"NONE"}.ignore(pos, expected))
|
|
{
|
|
result->none = true;
|
|
return true;
|
|
}
|
|
String database_name;
|
|
if (parseIdentifierOrStringLiteral(pos, expected, database_name))
|
|
{
|
|
result->database_name = database_name;
|
|
return true;
|
|
}
|
|
return false;
|
|
|
|
|
|
}
|
|
|
|
}
|