dressipi sprint 1 work in progress, labels function support, delete all
This commit is contained in:
@@ -17,5 +17,6 @@ enum class ClauseAction : uint32_t
|
||||
ReturnRelationship,
|
||||
ReturnPack,
|
||||
ReturnProjection,
|
||||
ReturnCount
|
||||
ReturnCount,
|
||||
ReturnLabels
|
||||
};
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
#pragma once
|
||||
|
||||
// TODO: refactor build state machine instead of ifs
|
||||
|
||||
#include "query_engine/code_generator/handlers/create.hpp"
|
||||
#include "query_engine/code_generator/handlers/delete.hpp"
|
||||
#include "query_engine/code_generator/handlers/match.hpp"
|
||||
|
||||
@@ -11,7 +11,7 @@ auto delete_query_action =
|
||||
for (auto const &kv : action_data.actions) {
|
||||
auto entity = kv.first;
|
||||
if (kv.second == ClauseAction::DeleteNode) {
|
||||
code += code_line("// DELETE Node({})", entity);
|
||||
code += code_line(detach_delete_all_nodes);
|
||||
}
|
||||
if (kv.second == ClauseAction::DeleteRelationship) {
|
||||
code += code_line("// DELETE Relationship({})", entity);
|
||||
|
||||
@@ -80,6 +80,10 @@ auto return_query_action =
|
||||
code += code_line(code::count, name);
|
||||
}
|
||||
}
|
||||
if (kv.second == ClauseAction::ReturnLabels)
|
||||
{
|
||||
// TODO: similar to above
|
||||
}
|
||||
}
|
||||
|
||||
return code;
|
||||
|
||||
@@ -126,3 +126,8 @@ const std::string print_properties =
|
||||
const std::string print_property =
|
||||
"cout_property(\"{0}\", {0}.property(\"{1}\"));";
|
||||
}
|
||||
|
||||
// DELETE
|
||||
const std::string detach_delete_all_nodes =
|
||||
"t.vertex_access().fill().isolated().for_all("
|
||||
" [&](auto a) {{ a.remove(); }});";
|
||||
|
||||
Reference in New Issue
Block a user