ClickHouse/src/Interpreters/InterpreterShowEngineQuery.cpp
Bharat Nallan ee37f551a2
independent registration of interpreters (#58443)
* make interpreter factory an instance

* add registerInterpreter

* register interpreters individually

* try wire everything up

* fix style

* fix test
2024-01-08 22:33:48 -08:00

29 lines
773 B
C++

#include <IO/ReadBufferFromString.h>
#include <Interpreters/Context.h>
#include <Interpreters/executeQuery.h>
#include <Interpreters/InterpreterFactory.h>
#include <Interpreters/InterpreterShowEngineQuery.h>
#include <Parsers/ASTQueryWithOutput.h>
namespace DB
{
BlockIO InterpreterShowEnginesQuery::execute()
{
return executeQuery("SELECT * FROM system.table_engines ORDER BY name", getContext(), QueryFlags{ .internal = true }).second;
}
void registerInterpreterShowEnginesQuery(InterpreterFactory & factory)
{
auto create_fn = [] (const InterpreterFactory::Arguments & args)
{
return std::make_unique<InterpreterShowEnginesQuery>(args.query, args.context);
};
factory.registerInterpreter("InterpreterShowEnginesQuery", create_fn);
}
}