From 1946ab6e07abe71c2fcdc1bcde13a218388a8a4a Mon Sep 17 00:00:00 2001
From: Dominik Gleich <dominik.gleich@memgraph.io>
Date: Mon, 27 Feb 2017 13:51:54 +0100
Subject: [PATCH] Update template.

Summary: Delete old implementations. Update template

Reviewers: buda

Reviewed By: buda

Subscribers: pullbot

Differential Revision: https://phabricator.memgraph.io/D72
---
 .../hardcoded_query/clique_001.cpp            | 171 ------------------
 .../hardcoded_query/create_account_return.cpp |  49 -----
 .../hardcoded_query/create_edge.cpp           |  43 -----
 .../create_label_name_return.cpp              |  39 ----
 .../create_other_name_return.cpp              |  39 ----
 .../hardcoded_query/create_prop_return.cpp    |  37 ----
 .../match_all_n_detach_delete.cpp             |  33 ----
 .../hardcoded_query/match_delete_garment.cpp  |  40 ----
 .../hardcoded_query/match_delete_profile.cpp  |  40 ----
 .../hardcoded_query/match_delete_score.cpp    |  82 ---------
 .../hardcoded_query/match_edge_score.cpp      |  80 --------
 .../match_garment_set_return.cpp              |  47 -----
 .../hardcoded_query/match_profile_return.cpp  |  41 -----
 .../hardcoded_query/match_return.cpp          |  41 -----
 .../merge_path_return_edge.cpp                |  65 -------
 .../hardcoded_query/merge_set_return.cpp      |  97 ----------
 tests/integration/hardcoded_query/template    |  30 +--
 17 files changed, 10 insertions(+), 964 deletions(-)
 delete mode 100644 tests/integration/hardcoded_query/clique_001.cpp
 delete mode 100644 tests/integration/hardcoded_query/create_account_return.cpp
 delete mode 100644 tests/integration/hardcoded_query/create_edge.cpp
 delete mode 100644 tests/integration/hardcoded_query/create_label_name_return.cpp
 delete mode 100644 tests/integration/hardcoded_query/create_other_name_return.cpp
 delete mode 100644 tests/integration/hardcoded_query/create_prop_return.cpp
 delete mode 100644 tests/integration/hardcoded_query/match_all_n_detach_delete.cpp
 delete mode 100644 tests/integration/hardcoded_query/match_delete_garment.cpp
 delete mode 100644 tests/integration/hardcoded_query/match_delete_profile.cpp
 delete mode 100644 tests/integration/hardcoded_query/match_delete_score.cpp
 delete mode 100644 tests/integration/hardcoded_query/match_edge_score.cpp
 delete mode 100644 tests/integration/hardcoded_query/match_garment_set_return.cpp
 delete mode 100644 tests/integration/hardcoded_query/match_profile_return.cpp
 delete mode 100644 tests/integration/hardcoded_query/match_return.cpp
 delete mode 100644 tests/integration/hardcoded_query/merge_path_return_edge.cpp
 delete mode 100644 tests/integration/hardcoded_query/merge_set_return.cpp

diff --git a/tests/integration/hardcoded_query/clique_001.cpp b/tests/integration/hardcoded_query/clique_001.cpp
deleted file mode 100644
index 24a130f64..000000000
--- a/tests/integration/hardcoded_query/clique_001.cpp
+++ /dev/null
@@ -1,171 +0,0 @@
-#include <iostream>
-#include <queue>
-#include <string>
-#include <vector>
-
-#include "query/plan_interface.hpp"
-#include "query/util.hpp"
-#include "storage/edge_x_vertex.hpp"
-#include "storage/model/properties/all.hpp"
-#include "storage/vertex_accessor.hpp"
-#include "using.hpp"
-#include "utils/memory/stack_allocator.hpp"
-
-using std::cout;
-using std::endl;
-
-// Dressipi astar query of 4 clicks.
-
-// Query: MATCH
-// (a:garment)-[:default_outfit]-(b:garment)-[:default_outfit]-(c:garment)-[:default_outfit]-(d:garment)-[:default_outfit]-(a:garment)-[:default_outfit]-(c:garment),
-// (b:garment)-[:default_outfit]-(d:garment) RETURN
-// a.garment_id,b.garment_id,c.garment_id,d.garment_id
-
-// TODO: figure out from the pattern in a query
-constexpr size_t max_depth = 3;
-
-// TODO: from query LIMIT 10
-constexpr size_t limit = 10;
-
-class Node {
- public:
-  Node *parent = {nullptr};
-  VertexPropertyType<Float> tkey;
-  double cost;
-  int depth = {0};
-  double sum = {0.0};
-  VertexAccessor vacc;
-
-  Node(VertexAccessor vacc, double cost, VertexPropertyType<Float> const &tkey)
-      : cost(cost), vacc(vacc), tkey(tkey) {}
-  Node(VertexAccessor vacc, double cost, Node *parent,
-       VertexPropertyType<Float> const &tkey)
-      : cost(cost),
-        vacc(vacc),
-        parent(parent),
-        depth(parent->depth + 1),
-        tkey(tkey) {}
-
-  double sum_vertex_score() {
-    auto now = this;
-    double sum = 0;
-    do {
-      sum += (now->vacc.at(tkey).get())->value();
-      now = now->parent;
-    } while (now != nullptr);
-    this->sum = sum;
-    return sum;
-  }
-};
-
-bool vertex_filter_contained(DbAccessor &t, VertexAccessor &v, Node *before) {
-  if (v.fill()) {
-    bool found;
-    do {
-      found = false;
-      before = before->parent;
-      if (before == nullptr) {
-        return true;
-      }
-    } while (v.in_contains(before->vacc));
-  }
-  return false;
-}
-
-template <typename Stream>
-auto astar(VertexAccessor &va, DbAccessor &t, plan_args_t &, Stream &) {
-  StackAllocator stack;
-  std::vector<Node *> results;
-
-  // TODO: variable part (extract)
-  VertexPropertyType<Float> tkey = t.vertex_property_key<Float>("score");
-
-  auto cmp = [](Node *left, Node *right) { return left->cost > right->cost; };
-  std::priority_queue<Node *, std::vector<Node *>, decltype(cmp)> queue(cmp);
-
-  Node *start = new (stack.allocate<Node>()) Node(va, 0, tkey);
-  queue.push(start);
-
-  size_t count = 0;
-  do {
-    auto now = queue.top();
-    queue.pop();
-
-    if (now->depth >= max_depth) {
-      now->sum_vertex_score();
-      results.emplace_back(now);
-
-      count++;
-
-      if (count >= limit) {
-        // the limit was reached -> STOP the execution
-        break;
-      }
-
-      // if the limit wasn't reached -> POP the next vertex
-      continue;
-    }
-
-    iter::for_all(now->vacc.out(), [&](auto edge) {
-      VertexAccessor va = edge.to();
-      if (vertex_filter_contained(t, va, now)) {
-        auto cost = 1 - va.at(tkey).get()->value();
-        Node *n =
-            new (stack.allocate<Node>()) Node(va, now->cost + cost, now, tkey);
-        queue.push(n);
-      }
-    });
-  } while (!queue.empty());
-
-  stack.free();
-
-  return results;
-}
-
-void reverse_stream_ids(Node *node, Stream &stream, VertexPropertyKey key) {
-  if (node == nullptr) return;
-  reverse_stream_ids(node->parent, stream, key);
-  stream.write(node->vacc.at(key).template as<Int64>());
-}
-
-class PlanCPU : public PlanInterface<Stream> {
- public:
-  bool run(Db &db, const PlanArgsT &args, Stream &stream) override {
-    DbAccessor t(db);
-
-    indices_t indices = {{"garment_id", 0}};
-    auto properties = query_properties(indices, args);
-
-    auto &label = t.label_find_or_create("garment");
-    auto garment_id_prop_key =
-        t.vertex_property_key("garment_id", args[0].key.flags());
-
-    stream.write_fields(
-        {{"a.garment_id", "b.garment_id", "c.garment_id", "d.garment_id"}});
-
-    label.index()
-        .for_range(t)
-        .properties_filter(t, properties)
-        .for_all([&](auto va) {
-          auto results = astar(va, t, args, stream);
-          std::sort(results.begin(), results.end(),
-                    [](Node *a, Node *b) { return a->sum > b->sum; });
-          for (auto node : results) {
-            stream.write_record();
-            stream.write_list_header(max_depth + 1);
-            reverse_stream_ids(node, stream, garment_id_prop_key);
-          }
-        });
-
-    stream.write_empty_fields();
-    stream.write_meta("r");
-
-    return t.commit();
-  }
-
-  ~PlanCPU() {}
-};
-
-extern "C" PlanInterface<Stream> *produce() { return new PlanCPU(); }
-
-extern "C" void destruct(PlanInterface<Stream> *p) { delete p; }
diff --git a/tests/integration/hardcoded_query/create_account_return.cpp b/tests/integration/hardcoded_query/create_account_return.cpp
deleted file mode 100644
index 7cbd479cb..000000000
--- a/tests/integration/hardcoded_query/create_account_return.cpp
+++ /dev/null
@@ -1,49 +0,0 @@
-#include <iostream>
-#include <string>
-
-#include "query/plan_interface.hpp"
-#include "query/util.hpp"
-#include "storage/edge_x_vertex.hpp"
-#include "storage/model/properties/all.hpp"
-#include "using.hpp"
-
-using std::cout;
-using std::endl;
-
-// Query: CREATE (n:ACCOUNT {id: 2322, name: "TEST", country: "Croatia",
-// "created_at": 2352352}) RETURN n
-
-class CPUPlan : public PlanInterface<Stream> {
- public:
-  bool run(Db &db, const PlanArgsT &args, Stream &stream) override {
-    DbAccessor t(db);
-
-    auto prop_id = t.vertex_property_key("id", args[0].key.flags());
-    auto prop_name = t.vertex_property_key("name", args[1].key.flags());
-    auto prop_country = t.vertex_property_key("country", args[2].key.flags());
-    auto prop_created =
-        t.vertex_property_key("created_at", args[3].key.flags());
-
-    auto &label = t.label_find_or_create("ACCOUNT");
-
-    auto vertex_accessor = t.vertex_insert();
-
-    vertex_accessor.set(prop_id, std::move(args[0]));
-    vertex_accessor.set(prop_name, std::move(args[1]));
-    vertex_accessor.set(prop_country, std::move(args[2]));
-    vertex_accessor.set(prop_created, std::move(args[3]));
-    vertex_accessor.add_label(label);
-
-    stream.write_field("p");
-    stream.write_vertex_record(vertex_accessor);
-    stream.write_meta("w");
-
-    return t.commit();
-  }
-
-  ~CPUPlan() {}
-};
-
-extern "C" PlanInterface<Stream> *produce() { return new CPUPlan(); }
-
-extern "C" void destruct(PlanInterface<Stream> *p) { delete p; }
diff --git a/tests/integration/hardcoded_query/create_edge.cpp b/tests/integration/hardcoded_query/create_edge.cpp
deleted file mode 100644
index 9428a3cc1..000000000
--- a/tests/integration/hardcoded_query/create_edge.cpp
+++ /dev/null
@@ -1,43 +0,0 @@
-#include <iostream>
-#include <string>
-
-#include "query/plan_interface.hpp"
-#include "query/util.hpp"
-#include "storage/edge_x_vertex.hpp"
-#include "storage/model/properties/all.hpp"
-#include "using.hpp"
-
-using std::cout;
-using std::endl;
-
-// Query: MATCH (a {id:0}), (p {id: 1}) CREATE (a)-[r:IS]->(p) RETURN r
-
-class CPUPlan : public PlanInterface<Stream> {
- public:
-  bool run(Db &db, const PlanArgsT &args, Stream &stream) override {
-    DbAccessor t(db);
-    auto &edge_type = t.type_find_or_create("IS");
-
-    auto v1 = t.vertex_find(args[0].as<Int64>().value());
-    if (!option_fill(v1)) return t.commit(), false;
-
-    auto v2 = t.vertex_find(args[1].as<Int64>().value());
-    if (!option_fill(v2)) return t.commit(), false;
-
-    auto edge_accessor = t.edge_insert(v1.get(), v2.get());
-
-    edge_accessor.edge_type(edge_type);
-
-    stream.write_field("r");
-    stream.write_edge_record(edge_accessor);
-    stream.write_meta("w");
-
-    return t.commit();
-  }
-
-  ~CPUPlan() {}
-};
-
-extern "C" PlanInterface<Stream> *produce() { return new CPUPlan(); }
-
-extern "C" void destruct(PlanInterface<Stream> *p) { delete p; }
diff --git a/tests/integration/hardcoded_query/create_label_name_return.cpp b/tests/integration/hardcoded_query/create_label_name_return.cpp
deleted file mode 100644
index b95962915..000000000
--- a/tests/integration/hardcoded_query/create_label_name_return.cpp
+++ /dev/null
@@ -1,39 +0,0 @@
-#include <iostream>
-#include <string>
-
-#include "query/plan_interface.hpp"
-#include "query/util.hpp"
-#include "storage/edge_x_vertex.hpp"
-#include "storage/model/properties/all.hpp"
-#include "using.hpp"
-
-using std::cout;
-using std::endl;
-
-// Query: CREATE (n:LABEL {name: "TEST"}) RETURN n
-
-class CPUPlan : public PlanInterface<Stream> {
- public:
-  bool run(Db &db, const PlanArgsT &args, Stream &stream) override {
-    DbAccessor t(db);
-
-    auto property_key = t.vertex_property_key("name", args[0].key.flags());
-    auto &label = t.label_find_or_create("LABEL");
-
-    auto vertex_accessor = t.vertex_insert();
-    vertex_accessor.set(property_key, std::move(args[0]));
-    vertex_accessor.add_label(label);
-
-    stream.write_field("n");
-    stream.write_vertex_record(vertex_accessor);
-    stream.write_meta("w");
-
-    return t.commit();
-  }
-
-  ~CPUPlan() {}
-};
-
-extern "C" PlanInterface<Stream> *produce() { return new CPUPlan(); }
-
-extern "C" void destruct(PlanInterface<Stream> *p) { delete p; }
diff --git a/tests/integration/hardcoded_query/create_other_name_return.cpp b/tests/integration/hardcoded_query/create_other_name_return.cpp
deleted file mode 100644
index 541b3d9f6..000000000
--- a/tests/integration/hardcoded_query/create_other_name_return.cpp
+++ /dev/null
@@ -1,39 +0,0 @@
-#include <iostream>
-#include <string>
-
-#include "query/plan_interface.hpp"
-#include "query/util.hpp"
-#include "storage/edge_x_vertex.hpp"
-#include "storage/model/properties/all.hpp"
-#include "using.hpp"
-
-using std::cout;
-using std::endl;
-
-// Query: CREATE (n:OTHER {name: "cleaner_test"}) RETURN n
-
-class CPUPlan : public PlanInterface<Stream> {
- public:
-  bool run(Db &db, const PlanArgsT &args, Stream &stream) override {
-    DbAccessor t(db);
-
-    auto property_key = t.vertex_property_key("name", args[0].key.flags());
-    auto &label = t.label_find_or_create("OTHER");
-
-    auto vertex_accessor = t.vertex_insert();
-    vertex_accessor.set(property_key, std::move(args[0]));
-    vertex_accessor.add_label(label);
-
-    stream.write_field("n");
-    stream.write_vertex_record(vertex_accessor);
-    stream.write_meta("w");
-
-    return t.commit();
-  }
-
-  ~CPUPlan() {}
-};
-
-extern "C" PlanInterface<Stream> *produce() { return new CPUPlan(); }
-
-extern "C" void destruct(PlanInterface<Stream> *p) { delete p; }
diff --git a/tests/integration/hardcoded_query/create_prop_return.cpp b/tests/integration/hardcoded_query/create_prop_return.cpp
deleted file mode 100644
index 828a22ce8..000000000
--- a/tests/integration/hardcoded_query/create_prop_return.cpp
+++ /dev/null
@@ -1,37 +0,0 @@
-#include <iostream>
-#include <string>
-
-#include "query/plan_interface.hpp"
-#include "query/util.hpp"
-#include "storage/edge_x_vertex.hpp"
-#include "storage/model/properties/all.hpp"
-#include "using.hpp"
-
-using std::cout;
-using std::endl;
-
-// Query: CREATE (n {prop: 0}) RETURN n
-
-class CPUPlan : public PlanInterface<Stream> {
- public:
-  bool run(Db &db, const PlanArgsT &args, Stream &stream) override {
-    DbAccessor t(db);
-
-    auto property_key = t.vertex_property_key("prop", args[0].key.flags());
-
-    auto vertex_accessor = t.vertex_insert();
-    vertex_accessor.set(property_key, std::move(args[0]));
-
-    stream.write_field("n");
-    stream.write_vertex_record(vertex_accessor);
-    stream.write_meta("w");
-
-    return t.commit();
-  }
-
-  ~CPUPlan() {}
-};
-
-extern "C" PlanInterface<Stream> *produce() { return new CPUPlan(); }
-
-extern "C" void destruct(PlanInterface<Stream> *p) { delete p; }
diff --git a/tests/integration/hardcoded_query/match_all_n_detach_delete.cpp b/tests/integration/hardcoded_query/match_all_n_detach_delete.cpp
deleted file mode 100644
index 6dcc562d4..000000000
--- a/tests/integration/hardcoded_query/match_all_n_detach_delete.cpp
+++ /dev/null
@@ -1,33 +0,0 @@
-#include <iostream>
-#include <string>
-
-#include "query/plan_interface.hpp"
-#include "query/util.hpp"
-#include "storage/model/properties/all.hpp"
-#include "using.hpp"
-
-using std::cout;
-using std::endl;
-
-// Query: MATCH (n) DETACH DELETE n
-
-class CPUPlan : public PlanInterface<Stream> {
- public:
-  bool run(Db &db, const PlanArgsT &args, Stream &stream) override {
-    DbAccessor t(db);
-
-    t.edge_access().fill().for_all([&](auto e) { e.remove(); });
-    t.vertex_access().fill().isolated().for_all([&](auto a) { a.remove(); });
-
-    stream.write_empty_fields();
-    stream.write_meta("w");
-
-    return t.commit();
-  }
-
-  ~CPUPlan() {}
-};
-
-extern "C" PlanInterface<Stream> *produce() { return new CPUPlan(); }
-
-extern "C" void destruct(PlanInterface<Stream> *p) { delete p; }
diff --git a/tests/integration/hardcoded_query/match_delete_garment.cpp b/tests/integration/hardcoded_query/match_delete_garment.cpp
deleted file mode 100644
index 9ca516b3a..000000000
--- a/tests/integration/hardcoded_query/match_delete_garment.cpp
+++ /dev/null
@@ -1,40 +0,0 @@
-#include <iostream>
-#include <string>
-
-#include "query/plan_interface.hpp"
-#include "query/util.hpp"
-#include "storage/model/properties/all.hpp"
-#include "using.hpp"
-
-using std::cout;
-using std::endl;
-
-// Query: MATCH (p:garment {garment_id: 1}) DELETE g
-
-class CPUPlan : public PlanInterface<Stream> {
- public:
-  bool run(Db &db, const PlanArgsT &args, Stream &stream) override {
-    DbAccessor t(db);
-
-    indices_t indices = {{"garment_id", 0}};
-    auto properties = query_properties(indices, args);
-
-    auto &label = t.label_find_or_create("garment");
-
-    label.index()
-        .for_range(t)
-        .properties_filter(t, properties)
-        .for_all([&](auto va) { va.remove(); });
-
-    stream.write_empty_fields();
-    stream.write_meta("w");
-
-    return t.commit();
-  }
-
-  ~CPUPlan() {}
-};
-
-extern "C" PlanInterface<Stream> *produce() { return new CPUPlan(); }
-
-extern "C" void destruct(PlanInterface<Stream> *p) { delete p; }
diff --git a/tests/integration/hardcoded_query/match_delete_profile.cpp b/tests/integration/hardcoded_query/match_delete_profile.cpp
deleted file mode 100644
index 9c9b24e6a..000000000
--- a/tests/integration/hardcoded_query/match_delete_profile.cpp
+++ /dev/null
@@ -1,40 +0,0 @@
-#include <iostream>
-#include <string>
-
-#include "query/plan_interface.hpp"
-#include "query/util.hpp"
-#include "storage/model/properties/all.hpp"
-#include "using.hpp"
-
-using std::cout;
-using std::endl;
-
-// Query: MATCH (p:profile {profile_id: 1}) DELETE p
-
-class CPUPlan : public PlanInterface<Stream> {
- public:
-  bool run(Db &db, const PlanArgsT &args, Stream &stream) override {
-    DbAccessor t(db);
-
-    indices_t indices = {{"profile_id", 0}};
-    auto properties = query_properties(indices, args);
-
-    auto &label = t.label_find_or_create("profile");
-
-    label.index()
-        .for_range(t)
-        .properties_filter(t, properties)
-        .for_all([&](auto va) { va.remove(); });
-
-    stream.write_empty_fields();
-    stream.write_meta("w");
-
-    return t.commit();
-  }
-
-  ~CPUPlan() {}
-};
-
-extern "C" PlanInterface<Stream> *produce() { return new CPUPlan(); }
-
-extern "C" void destruct(PlanInterface<Stream> *p) { delete p; }
diff --git a/tests/integration/hardcoded_query/match_delete_score.cpp b/tests/integration/hardcoded_query/match_delete_score.cpp
deleted file mode 100644
index 4185115f0..000000000
--- a/tests/integration/hardcoded_query/match_delete_score.cpp
+++ /dev/null
@@ -1,82 +0,0 @@
-#include <iostream>
-#include <string>
-
-#include "query/plan_interface.hpp"
-#include "query/util.hpp"
-#include "storage/edge_x_vertex.hpp"
-#include "storage/model/properties/all.hpp"
-#include "using.hpp"
-
-using std::cout;
-using std::endl;
-
-// Query: MATCH (p:profile {profile_id: 111,
-// partner_id:55})-[s:score]-(g:garment {garment_id: 1234}) DELETE s
-
-class CPUPlan : public PlanInterface<Stream> {
- public:
-  bool run(Db &db, const PlanArgsT &args, Stream &stream) override {
-    DbAccessor t(db);
-
-    auto &profile = t.label_find_or_create("profile");
-    auto &score = t.type_find_or_create("score");
-    auto &garment = t.label_find_or_create("garment");
-
-    indices_t profile_ind = {{"profile_id", 0}, {"partner_id", 1}};
-    indices_t garment_ind = {{"garment_id", 2}};
-
-    auto profile_prop = query_properties(profile_ind, args);
-    auto garment_prop = query_properties(garment_ind, args);
-
-    auto score_key = t.edge_property_key("score", args[3].key.flags());
-
-    // TODO: decide path (which index is better)
-    //       3 options p->s->g, g->s->p, g<-s->p
-    //       NOTE! both direections have to be chacked
-    //       because pattern is non directional
-    //       OR
-    //       even better, use index on label and property
-
-    // just one option p->s->g!
-    Option<const EdgeAccessor> e1;
-    profile.index()
-        .for_range(t)
-        .properties_filter(t, profile_prop)
-        .out()
-        .type(score)
-        .clone_to(e1)
-        .to()
-        .label(garment)
-        .properties_filter(t, garment_prop)
-        .for_all([&](auto va) -> void {
-          auto ea = e1.get().update();
-          ea.remove();
-        });
-
-    Option<const EdgeAccessor> e2;
-    profile.index()
-        .for_range(t)
-        .properties_filter(t, profile_prop)
-        .in()
-        .type(score)
-        .clone_to(e1)
-        .from()
-        .label(garment)
-        .properties_filter(t, garment_prop)
-        .for_all([&](auto va) -> void {
-          auto ea = e2.get().update();
-          ea.remove();
-        });
-
-    stream.write_empty_fields();
-    stream.write_meta("w");
-
-    return t.commit();
-  }
-
-  ~CPUPlan() {}
-};
-
-extern "C" PlanInterface<Stream> *produce() { return new CPUPlan(); }
-
-extern "C" void destruct(PlanInterface<Stream> *p) { delete p; }
diff --git a/tests/integration/hardcoded_query/match_edge_score.cpp b/tests/integration/hardcoded_query/match_edge_score.cpp
deleted file mode 100644
index bd58d925d..000000000
--- a/tests/integration/hardcoded_query/match_edge_score.cpp
+++ /dev/null
@@ -1,80 +0,0 @@
-#include <iostream>
-#include <string>
-
-#include "query/plan_interface.hpp"
-#include "query/util.hpp"
-#include "storage/edge_x_vertex.hpp"
-#include "storage/model/properties/all.hpp"
-#include "using.hpp"
-
-using std::cout;
-using std::endl;
-
-// Query: MATCH (p:profile {profile_id: 111,
-// partner_id:55})-[s:score]-(g:garment {garment_id: 1234}) SET s.score = 1550
-// RETURN s.score
-
-class CPUPlan : public PlanInterface<Stream> {
- public:
-  bool run(Db &db, const PlanArgsT &args, Stream &stream) override {
-    DbAccessor t(db);
-
-    auto &profile = t.label_find_or_create("profile");
-    auto &score = t.type_find_or_create("score");
-    auto &garment = t.label_find_or_create("garment");
-
-    indices_t profile_ind = {{"profile_id", 0}, {"partner_id", 1}};
-    indices_t garment_ind = {{"garment_id", 2}};
-
-    auto profile_prop = query_properties(profile_ind, args);
-    auto garment_prop = query_properties(garment_ind, args);
-
-    auto score_key = t.edge_property_key("score", args[3].key.flags());
-
-    // TODO: decide path (which index is better)
-    //       3 options p->s->g, g->s->p, g<-s->p
-    //       NOTE! both direections have to be chacked
-    //       because pattern is non directional
-    //       OR
-    //       even better, use index on label and property
-
-    // just one option p->s->g!
-    Option<const EdgeAccessor> e1;
-    profile.index()
-        .for_range(t)
-        .properties_filter(t, profile_prop)
-        .out()
-        .type(score)
-        .clone_to(e1)
-        .to()
-        .label(garment)
-        .properties_filter(t, garment_prop)
-        .for_all([&](auto va) -> void {
-          auto ea = e1.get().update();
-          ea.set(score_key, std::move(args[3]));
-        });
-
-    Option<const EdgeAccessor> e2;
-    profile.index()
-        .for_range(t)
-        .properties_filter(t, profile_prop)
-        .in()
-        .type(score)
-        .clone_to(e1)
-        .from()
-        .label(garment)
-        .properties_filter(t, garment_prop)
-        .for_all([&](auto va) -> void {
-          auto ea = e2.get().update();
-          ea.set(score_key, std::move(args[3]));
-        });
-
-    return t.commit();
-  }
-
-  ~CPUPlan() {}
-};
-
-extern "C" PlanInterface<Stream> *produce() { return new CPUPlan(); }
-
-extern "C" void destruct(PlanInterface<Stream> *p) { delete p; }
diff --git a/tests/integration/hardcoded_query/match_garment_set_return.cpp b/tests/integration/hardcoded_query/match_garment_set_return.cpp
deleted file mode 100644
index e39acff57..000000000
--- a/tests/integration/hardcoded_query/match_garment_set_return.cpp
+++ /dev/null
@@ -1,47 +0,0 @@
-#include <iostream>
-#include <string>
-
-#include "query/plan_interface.hpp"
-#include "query/util.hpp"
-#include "storage/model/properties/all.hpp"
-#include "using.hpp"
-
-using std::cout;
-using std::endl;
-
-// Query: MATCH (g:garment {garment_id: 3456}) SET g.reveals = 50 RETURN g
-
-class CPUPlan : public PlanInterface<Stream> {
- public:
-  bool run(Db &db, const PlanArgsT &args, Stream &stream) override {
-    DbAccessor t(db);
-
-    auto reveals_key = t.vertex_property_key("reveals", args[1].key.flags());
-
-    indices_t indices = {{"garment_id", 0}};
-    auto properties = query_properties(indices, args);
-
-    auto &label = t.label_find_or_create("garment");
-
-    stream.write_field("g");
-
-    label.index()
-        .for_range(t)
-        .properties_filter(t, properties)
-        .fill()
-        .for_all([&](auto va) {
-          va.set(reveals_key, args[1]);
-          stream.write_vertex_record(va);
-        });
-
-    stream.write_meta("w");
-
-    return t.commit();
-  }
-
-  ~CPUPlan() {}
-};
-
-extern "C" PlanInterface<Stream> *produce() { return new CPUPlan(); }
-
-extern "C" void destruct(PlanInterface<Stream> *p) { delete p; }
diff --git a/tests/integration/hardcoded_query/match_profile_return.cpp b/tests/integration/hardcoded_query/match_profile_return.cpp
deleted file mode 100644
index c10cc9861..000000000
--- a/tests/integration/hardcoded_query/match_profile_return.cpp
+++ /dev/null
@@ -1,41 +0,0 @@
-#include <iostream>
-#include <string>
-
-#include "query/plan_interface.hpp"
-#include "query/util.hpp"
-#include "storage/model/properties/all.hpp"
-#include "using.hpp"
-
-using std::cout;
-using std::endl;
-
-// Query: MATCH (p:profile {partner_id: 1}) RETURN p
-
-class CPUPlan : public PlanInterface<Stream> {
- public:
-  bool run(Db &db, const PlanArgsT &args, Stream &stream) override {
-    DbAccessor t(db);
-
-    indices_t indices = {{"partner_id", 0}};
-    auto properties = query_properties(indices, args);
-
-    auto &label = t.label_find_or_create("profile");
-
-    stream.write_field("p");
-
-    label.index()
-        .for_range(t)
-        .properties_filter(t, properties)
-        .for_all([&](auto va) { stream.write_vertex_record(va); });
-
-    stream.write_meta("r");
-
-    return t.commit();
-  }
-
-  ~CPUPlan() {}
-};
-
-extern "C" PlanInterface<Stream> *produce() { return new CPUPlan(); }
-
-extern "C" void destruct(PlanInterface<Stream> *p) { delete p; }
diff --git a/tests/integration/hardcoded_query/match_return.cpp b/tests/integration/hardcoded_query/match_return.cpp
deleted file mode 100644
index 690570a81..000000000
--- a/tests/integration/hardcoded_query/match_return.cpp
+++ /dev/null
@@ -1,41 +0,0 @@
-#include <iostream>
-#include <string>
-
-#include "query/plan_interface.hpp"
-#include "query/util.hpp"
-#include "storage/model/properties/all.hpp"
-#include "using.hpp"
-
-using std::cout;
-using std::endl;
-
-// Query: MATCH (g:garment {garment_id: 1}) RETURN g
-
-class CPUPlan : public PlanInterface<Stream> {
- public:
-  bool run(Db &db, const PlanArgsT &args, Stream &stream) override {
-    DbAccessor t(db);
-
-    indices_t indices = {{"garment_id", 0}};
-    auto properties = query_properties(indices, args);
-
-    auto &label = t.label_find_or_create("garment");
-
-    stream.write_field("g");
-
-    label.index()
-        .for_range(t)
-        .properties_filter(t, properties)
-        .for_all([&](auto va) -> void { stream.write_vertex_record(va); });
-
-    stream.write_meta("w");
-
-    return t.commit();
-  }
-
-  ~CPUPlan() {}
-};
-
-extern "C" PlanInterface<Stream> *produce() { return new CPUPlan(); }
-
-extern "C" void destruct(PlanInterface<Stream> *p) { delete p; }
diff --git a/tests/integration/hardcoded_query/merge_path_return_edge.cpp b/tests/integration/hardcoded_query/merge_path_return_edge.cpp
deleted file mode 100644
index 0f87689f6..000000000
--- a/tests/integration/hardcoded_query/merge_path_return_edge.cpp
+++ /dev/null
@@ -1,65 +0,0 @@
-#include <iostream>
-#include <string>
-
-#include "query/plan_interface.hpp"
-#include "query/util.hpp"
-#include "storage/model/properties/all.hpp"
-#include "using.hpp"
-
-using std::cout;
-using std::endl;
-
-// Query: MERGE (g1:garment {garment_id:1234})-[r:default_outfit]-(g2:garment
-// {garment_id: 2345}) RETURN r
-
-class CPUPlan : public PlanInterface<Stream> {
- public:
-  bool run(Db &db, const PlanArgsT &args, Stream &stream) override {
-    DbAccessor t(db);
-
-    // TODO: support for index on label and property
-
-    // prepare iterator for g1
-    indices_t indices_1 = {{"garment_id", 0}};
-    auto properties_1 = query_properties(indices_1, args);
-    auto &label_1 = t.label_find_or_create("garment");
-
-    auto it_vertex_1 =
-        label_1.index().for_range(t).properties_filter(t, properties_1);
-
-    // prepare iterator for g1
-    indices_t indices_2 = {{"garment_id", 1}};
-    auto properties_2 = query_properties(indices_2, args);
-    auto &label_2 = t.label_find_or_create("garment");
-
-    auto it_vertex_2 =
-        label_2.index().for_range(t).properties_filter(t, properties_2);
-
-    auto &edge_type = t.type_find_or_create("default_outfit");
-
-    // TODO: create g1 and g2 if don't exist
-
-    // TODO: figure out something better
-
-    stream.write_field("r");
-
-    it_vertex_1.fill().for_all([&](auto va1) -> void {
-      it_vertex_2.fill().for_all([&](auto va2) -> void {
-        auto edge_accessor = t.edge_insert(va1, va2);
-        edge_accessor.edge_type(edge_type);
-
-        stream.write_edge_record(edge_accessor);
-      });
-    });
-
-    stream.write_meta("w");
-
-    return t.commit();
-  }
-
-  ~CPUPlan() {}
-};
-
-extern "C" PlanInterface<Stream> *produce() { return new CPUPlan(); }
-
-extern "C" void destruct(PlanInterface<Stream> *p) { delete p; }
diff --git a/tests/integration/hardcoded_query/merge_set_return.cpp b/tests/integration/hardcoded_query/merge_set_return.cpp
deleted file mode 100644
index 0a6964477..000000000
--- a/tests/integration/hardcoded_query/merge_set_return.cpp
+++ /dev/null
@@ -1,97 +0,0 @@
-#include <iostream>
-#include <string>
-
-#include "query/plan_interface.hpp"
-#include "query/util.hpp"
-#include "storage/edge_x_vertex.hpp"
-#include "storage/model/properties/all.hpp"
-#include "using.hpp"
-
-using std::cout;
-using std::endl;
-
-// Query: MERGE (p:profile {profile_id: 111, partner_id:
-// 55})-[s:score]-(g.garment {garment_id: 1234}) SET s.score=1500 RETURN s
-
-class CPUPlan : public PlanInterface<Stream> {
- public:
-  bool run(Db &db, const PlanArgsT &args, Stream &stream) override {
-    DbAccessor t(db);
-
-    auto &profile = t.label_find_or_create("profile");
-    auto &score = t.type_find_or_create("score");
-    auto &garment = t.label_find_or_create("garment");
-
-    indices_t profile_ind = {{"profile_id", 0}, {"partner_id", 1}};
-    indices_t garment_ind = {{"garment_id", 2}};
-
-    auto profile_prop = query_properties(profile_ind, args);
-    auto garment_prop = query_properties(garment_ind, args);
-
-    auto score_key = t.edge_property_key("score", args[3].key.flags());
-
-    stream.write_field("s");
-
-    // TODO: implement
-    bool exists = false;
-    Option<const EdgeAccessor> e1;
-    profile.index()
-        .for_range(t)
-        .properties_filter(t, profile_prop)
-        .out()
-        .type(score)
-        .clone_to(e1)
-        .to()
-        .label(garment)
-        .properties_filter(t, garment_prop)
-        .for_all([&](auto va) -> void {
-          exists = true;
-          auto ea = e1.get().update();
-          ea.set(score_key, args[3]);
-          stream.write_edge_record(ea);
-        });
-
-    Option<const EdgeAccessor> e2;
-    profile.index()
-        .for_range(t)
-        .properties_filter(t, profile_prop)
-        .in()
-        .type(score)
-        .clone_to(e1)
-        .from()
-        .label(garment)
-        .properties_filter(t, garment_prop)
-        .for_all([&](auto va) -> void {
-          exists = true;
-          auto ea = e2.get().update();
-          ea.set(score_key, args[3]);
-          stream.write_edge_record(ea);
-        });
-
-    if (!exists) {
-      auto it_vertex_garment =
-          garment.index().for_range(t).properties_filter(t, garment_prop);
-      auto it_vertex_profile =
-          profile.index().for_range(t).properties_filter(t, profile_prop);
-
-      it_vertex_profile.fill().for_all([&](auto va1) -> void {
-        it_vertex_garment.fill().for_all([&](auto va2) -> void {
-          auto ea = t.edge_insert(va1, va2);
-          ea.edge_type(score);
-          ea.set(score_key, args[3]);
-          stream.write_edge_record(ea);
-        });
-      });
-    }
-
-    stream.write_field("w");
-
-    return t.commit();
-  }
-
-  ~CPUPlan() {}
-};
-
-extern "C" PlanInterface<Stream> *produce() { return new CPUPlan(); }
-
-extern "C" void destruct(PlanInterface<Stream> *p) { delete p; }
diff --git a/tests/integration/hardcoded_query/template b/tests/integration/hardcoded_query/template
index d8df56546..9d234b736 100644
--- a/tests/integration/hardcoded_query/template
+++ b/tests/integration/hardcoded_query/template
@@ -1,10 +1,7 @@
 #include <iostream>
 #include <string>
 
-#include "query/util.hpp"
 #include "query/plan_interface.hpp"
-#include "storage/model/properties/all.hpp"
-#include "storage/edge_x_vertex.hpp"
 #include "using.hpp"
 
 using std::cout;
@@ -12,24 +9,17 @@ using std::endl;
 
 // Query:
 
-class CPUPlan : public PlanInterface<Stream>
-{
-public:
+class CPUPlan : public PlanInterface<Stream> {
+ public:
+  bool run(GraphDbAccessor &db_accessor, const TypedValueStore<> &args,
+           Stream &stream) {
+    db_accessor.transaction_.commit();
+    return true;
+  }
 
-    bool run(Db &db, const PlanArgsT &args, Stream &stream) override
-    {
-
-    }
-
-    ~CPUPlan() {}
+  ~CPUPlan() {}
 };
 
-extern "C" PlanInterface<Stream>* produce()
-{
-    return new CPUPlan();
-}
+extern "C" PlanInterface<Stream> *produce() { return new CPUPlan(); }
 
-extern "C" void destruct(PlanInterface<Stream>* p)
-{
-    delete p;
-}
+extern "C" void destruct(PlanInterface<Stream> *p) { delete p; }