2017-02-28 19:14:49 +08:00
|
|
|
#include <iostream>
|
|
|
|
#include <string>
|
|
|
|
|
|
|
|
#include "query/plan_interface.hpp"
|
|
|
|
#include "using.hpp"
|
|
|
|
|
|
|
|
using std::cout;
|
|
|
|
using std::endl;
|
|
|
|
|
|
|
|
// Query: MATCH (n) DETACH DELETE n
|
|
|
|
|
|
|
|
class CPUPlan : public PlanInterface<Stream> {
|
|
|
|
public:
|
2017-03-01 02:38:57 +08:00
|
|
|
bool run(GraphDbAccessor &db_accessor, const PropertyValueStore<> &args,
|
2017-02-28 19:14:49 +08:00
|
|
|
Stream &stream) {
|
|
|
|
for (auto v : db_accessor.vertices()) db_accessor.detach_remove_vertex(v);
|
2017-02-28 23:50:50 +08:00
|
|
|
stream.write_empty_fields();
|
|
|
|
stream.write_meta("rw");
|
2017-02-28 19:14:49 +08:00
|
|
|
db_accessor.transaction_.commit();
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
~CPUPlan() {}
|
|
|
|
};
|
|
|
|
|
|
|
|
extern "C" PlanInterface<Stream> *produce() { return new CPUPlan(); }
|
|
|
|
|
|
|
|
extern "C" void destruct(PlanInterface<Stream> *p) { delete p; }
|