dressipi sprint 1 work in progress, labels function support, delete all

This commit is contained in:
Marko Budiselic
2016-10-11 02:43:41 +02:00
parent f5cf9c72d2
commit 51b17c2402
21 changed files with 115 additions and 48 deletions

View File

@@ -17,5 +17,6 @@ enum class ClauseAction : uint32_t
ReturnRelationship,
ReturnPack,
ReturnProjection,
ReturnCount
ReturnCount,
ReturnLabels
};

View File

@@ -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"

View File

@@ -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);

View File

@@ -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;

View File

@@ -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(); }});";