2016-07-25 09:09:40 +08:00
|
|
|
#pragma once
|
|
|
|
|
2016-11-02 23:05:02 +08:00
|
|
|
#include "includes.hpp"
|
2016-07-25 09:09:40 +08:00
|
|
|
|
|
|
|
auto delete_query_action =
|
|
|
|
[](CypherStateData &cypher_data,
|
|
|
|
const QueryActionData &action_data) -> std::string {
|
|
|
|
|
|
|
|
std::string code = "";
|
|
|
|
|
|
|
|
for (auto const &kv : action_data.actions) {
|
|
|
|
auto entity = kv.first;
|
2016-11-02 23:05:02 +08:00
|
|
|
if (kv.second == ClauseAction::DeleteNode && action_data.is_detach) {
|
|
|
|
code += code_line(delete_whole_graph);
|
|
|
|
}
|
|
|
|
if (kv.second == ClauseAction::DeleteNode && !action_data.is_detach) {
|
|
|
|
code += code_line(delete_all_detached_nodes);
|
2016-07-25 09:09:40 +08:00
|
|
|
}
|
|
|
|
if (kv.second == ClauseAction::DeleteRelationship) {
|
2016-08-08 16:32:34 +08:00
|
|
|
code += code_line("// DELETE Relationship({})", entity);
|
2016-07-25 09:09:40 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return code;
|
|
|
|
};
|