memgraph/include/query_engine/program_executor.hpp

29 lines
678 B
C++
Raw Normal View History

#pragma once
#include <string>
#include "database/db.hpp"
2016-07-18 01:32:35 +08:00
#include "query_engine/util.hpp"
#include "query_program.hpp"
#include "utils/log/logger.hpp"
#include "query_engine/exceptions/exceptions.hpp"
// preparations before execution
// execution
// postprocess the results
class ProgramExecutor
{
public:
auto execute(QueryProgram &program, Db& db)
{
2016-07-18 01:32:35 +08:00
try {
// TODO: return result of query/code exection
return program.code->run(db, program.stripped.arguments);
} catch (...) {
// TODO: return more information about the error
throw QueryEngineException("code execution error");
}
}
};