| 188 | } |
| 189 | |
| 190 | ASTPtr 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 | |
| 208 | void DatabaseFilesystem::shutdown() |
| 209 | { |
nothing calls this directly
no test coverage detected