MCPcopy Create free account
hub / github.com/ClickHouse/ClickHouse / getCreateDatabaseQueryImpl

Method getCreateDatabaseQueryImpl

src/Databases/DatabaseFilesystem.cpp:190–206  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

188}
189
190ASTPtr DatabaseFilesystem::getCreateDatabaseQueryImpl() const
191{
192 const auto & settings = getContext()->getSettingsRef();
193 const String query = fmt::format("CREATE DATABASE {} ENGINE = Filesystem('{}')", backQuoteIfNeed(database_name), path);
194
195 ParserCreateQuery parser;
196 ASTPtr ast
197 = parseQuery(parser, query.data(), query.data() + query.size(), "", 0, settings[Setting::max_parser_depth], settings[Setting::max_parser_backtracks]);
198
199 if (!comment.empty())
200 {
201 auto & ast_create_query = ast->as<ASTCreateQuery &>();
202 ast_create_query.set(ast_create_query.comment, make_intrusive<ASTLiteral>(comment));
203 }
204
205 return ast;
206}
207
208void DatabaseFilesystem::shutdown()
209{

Callers

nothing calls this directly

Calls 8

backQuoteIfNeedFunction · 0.85
parseQueryFunction · 0.85
getContextFunction · 0.50
formatFunction · 0.50
dataMethod · 0.45
sizeMethod · 0.45
emptyMethod · 0.45
setMethod · 0.45

Tested by

no test coverage detected