2016-02-22 05:21:15 +08:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <string>
|
|
|
|
|
|
|
|
#include "database/db.hpp"
|
2016-02-26 14:45:43 +08:00
|
|
|
#include "query_engine/debug.hpp"
|
2016-06-06 17:29:52 +08:00
|
|
|
#include "query_program.hpp"
|
|
|
|
#include "utils/log/logger.hpp"
|
2016-02-22 05:21:15 +08:00
|
|
|
|
|
|
|
// preparations before execution
|
|
|
|
// execution
|
|
|
|
// postprocess the results
|
|
|
|
|
|
|
|
class ProgramExecutor
|
|
|
|
{
|
|
|
|
public:
|
2016-06-06 17:29:52 +08:00
|
|
|
auto execute(QueryProgram &program)
|
2016-02-22 05:21:15 +08:00
|
|
|
{
|
2016-07-11 09:39:33 +08:00
|
|
|
return program.code->run(db, program.stripped.arguments);
|
2016-02-22 05:21:15 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
public:
|
|
|
|
Db db;
|
|
|
|
};
|