xale-db 1.0
minimal SQL engine, written in c++
Loading...
Searching...
No Matches
QueryEngine.h
Go to the documentation of this file.
1#ifndef ENGINE_QUERY_ENGINE_H
2#define ENGINE_QUERY_ENGINE_H
3
4#include "Query/IParser.h"
5#include "Query/Statement.h"
8
9#include <string>
10#include <memory>
11
12namespace Xale::Engine
13{
15 {
16 public:
17 QueryEngine() = default;
19 Xale::Query::IParser* parser,
21 bool run(std::string sqlQuery);
22 std::unique_ptr<Xale::DataStructure::ResultSet> getResults();
23 std::string getResultsToString();
24 private:
25 Xale::Query::IParser* _parser;
27 std::unique_ptr<Xale::DataStructure::ResultSet> _results;
28 Xale::Query::StatementType _lastStatementType;
29
30 std::string formatSelectResult();
31 std::string formatInsertResult();
32 std::string formatUpdateResult();
33 std::string formatDeleteResult();
34 std::string formatCreateResult();
35 std::string formatDropResult();
36 };
37}
38
39#endif // ENGINE_QUERY_ENGINE_H
std::unique_ptr< Xale::DataStructure::ResultSet > getResults()
Get the last runned query results.
Definition QueryEngine.cpp:37
bool run(std::string sqlQuery)
Run the given string query.
Definition QueryEngine.cpp:24
std::string getResultsToString()
Get the last runned query results as a formatted string.
Definition QueryEngine.cpp:49
Definition IExecutor.h:12
Interface for SQL parsers.
Definition IParser.h:16
Definition QueryEngine.h:13
StatementType
Types of SQL statements.
Definition Statement.h:15