2017-11-23 21:26:53 +08:00
|
|
|
#include "communication/result_stream_faker.hpp"
|
2018-10-05 18:37:23 +08:00
|
|
|
#include "database/single_node/graph_db.hpp"
|
|
|
|
#include "database/single_node/graph_db_accessor.hpp"
|
2017-11-23 21:26:53 +08:00
|
|
|
#include "query/interpreter.hpp"
|
|
|
|
|
|
|
|
int main(int argc, char *argv[]) {
|
|
|
|
gflags::ParseCommandLineFlags(&argc, &argv, true);
|
|
|
|
|
|
|
|
// parse the first cmd line argument as the query
|
|
|
|
if (argc < 2) {
|
|
|
|
std::cout << "Usage: ./single_query 'RETURN \"query here\"'" << std::endl;
|
|
|
|
exit(1);
|
|
|
|
}
|
2018-10-09 17:09:10 +08:00
|
|
|
database::GraphDb db;
|
2018-07-26 15:08:21 +08:00
|
|
|
auto dba = db.Access();
|
2018-07-20 18:31:22 +08:00
|
|
|
ResultStreamFaker<query::TypedValue> stream;
|
2019-04-15 17:36:43 +08:00
|
|
|
auto results = query::Interpreter()(argv[1], dba, {}, false);
|
2018-07-20 18:31:22 +08:00
|
|
|
stream.Header(results.header());
|
|
|
|
results.PullAll(stream);
|
|
|
|
stream.Summary(results.summary());
|
|
|
|
std::cout << stream;
|
2017-11-23 21:26:53 +08:00
|
|
|
return 0;
|
|
|
|
}
|