alpha release script + bolt serialization works (nodes and edges)
This commit is contained in:
parent
93b174afd7
commit
e1cca548ba
2
.gitignore
vendored
2
.gitignore
vendored
@ -15,3 +15,5 @@ tags
|
|||||||
.gdb_history
|
.gdb_history
|
||||||
Testing/
|
Testing/
|
||||||
ve/
|
ve/
|
||||||
|
release/memgraph_*
|
||||||
|
release/libs/
|
||||||
|
@ -434,17 +434,22 @@ endif()
|
|||||||
|
|
||||||
# memgraph build name
|
# memgraph build name
|
||||||
execute_process(
|
execute_process(
|
||||||
OUTPUT_VARIABLE COMMIT_NO
|
OUTPUT_VARIABLE COMMIT_BRANCH
|
||||||
COMMAND git rev-list --count HEAD
|
COMMAND git rev-parse --abbrev-ref HEAD
|
||||||
)
|
)
|
||||||
execute_process(
|
execute_process(
|
||||||
OUTPUT_VARIABLE COMMIT_HASH
|
OUTPUT_VARIABLE COMMIT_HASH
|
||||||
COMMAND git rev-parse --short HEAD
|
COMMAND git rev-parse --short HEAD
|
||||||
)
|
)
|
||||||
string(STRIP ${COMMIT_HASH} COMMIT_HASH)
|
execute_process(
|
||||||
|
OUTPUT_VARIABLE COMMIT_NO
|
||||||
|
COMMAND git rev-list --count HEAD
|
||||||
|
)
|
||||||
|
string(STRIP ${COMMIT_BRANCH} COMMIT_BRANCH)
|
||||||
string(STRIP ${COMMIT_NO} COMMIT_NO)
|
string(STRIP ${COMMIT_NO} COMMIT_NO)
|
||||||
|
string(STRIP ${COMMIT_HASH} COMMIT_HASH)
|
||||||
set(MEMGRAPH_BUILD_NAME
|
set(MEMGRAPH_BUILD_NAME
|
||||||
"memgraph_${COMMIT_HASH}_${COMMIT_NO}_${CMAKE_BUILD_TYPE}")
|
"memgraph_${COMMIT_BRANCH}_${COMMIT_HASH}_${COMMIT_NO}_${CMAKE_BUILD_TYPE}")
|
||||||
|
|
||||||
# memgraph main executable
|
# memgraph main executable
|
||||||
if (MEMGRAPH)
|
if (MEMGRAPH)
|
||||||
|
@ -56,6 +56,7 @@ public:
|
|||||||
encoder.write_map_header(props.size());
|
encoder.write_map_header(props.size());
|
||||||
|
|
||||||
for(auto& prop : props) {
|
for(auto& prop : props) {
|
||||||
|
// std::cout << prop.first << " " << *prop.second << std::endl;
|
||||||
write(prop.first);
|
write(prop.first);
|
||||||
write(*prop.second);
|
write(*prop.second);
|
||||||
}
|
}
|
||||||
|
@ -55,7 +55,7 @@ public:
|
|||||||
{"query", query},
|
{"query", query},
|
||||||
{"code", cpp_traverser.code}});
|
{"code", cpp_traverser.code}});
|
||||||
|
|
||||||
logger.trace("generated code: {}", generated);
|
// logger.trace("generated code: {}", generated);
|
||||||
|
|
||||||
utils::write_file(generated, path);
|
utils::write_file(generated, path);
|
||||||
}
|
}
|
||||||
|
@ -45,14 +45,15 @@ const std::string vertex_accessor_args_id =
|
|||||||
|
|
||||||
const std::string match_vertex_by_id =
|
const std::string match_vertex_by_id =
|
||||||
"auto {0} = db.graph.vertices.find(t, args[{1}]->as<Int64>().value);\n"
|
"auto {0} = db.graph.vertices.find(t, args[{1}]->as<Int64>().value);\n"
|
||||||
" if (!{0}) return t.commit(), std::make_shared<QueryResult>();";
|
" if (!{0}) return t.commit(), false;";
|
||||||
const std::string match_edge_by_id =
|
const std::string match_edge_by_id =
|
||||||
"auto {0} = db.graph.edges.find(t, args[{1}]->as<Int64>().value);\n"
|
"auto {0} = db.graph.edges.find(t, args[{1}]->as<Int64>().value);\n"
|
||||||
" if (!{0}) return t.commit(), std::make_shared<QueryResult>();";
|
" if (!{0}) return t.commit(), false;";
|
||||||
|
|
||||||
const std::string write_entity =
|
const std::string write_entity =
|
||||||
"stream.write_field(\"{0}\");\n"
|
"stream.write_field(\"{0}\");\n"
|
||||||
" stream.write_record();\n"
|
" stream.write_record();\n"
|
||||||
|
" stream.write_list_header(1);\n"
|
||||||
" stream.write({0});\n"
|
" stream.write({0});\n"
|
||||||
" stream.write_success_empty();\n";
|
" stream.write_success_empty();\n";
|
||||||
|
|
||||||
|
42
release/alpha.sh
Executable file
42
release/alpha.sh
Executable file
@ -0,0 +1,42 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
# Initial version of script that is going to be used for release build.
|
||||||
|
|
||||||
|
# TODO: enable options related to lib
|
||||||
|
|
||||||
|
echo "Memgraph Release Building..."
|
||||||
|
|
||||||
|
cd ../build
|
||||||
|
# get most recent version of memgraph exe
|
||||||
|
exe_name=`ls -t memgraph_* | head -1`
|
||||||
|
|
||||||
|
cd ../release
|
||||||
|
# create libs dir
|
||||||
|
mkdir -p libs
|
||||||
|
|
||||||
|
# initialize all libs
|
||||||
|
# cp ../libs/setup.sh libs/setup.sh
|
||||||
|
# ./libs/setup.sh
|
||||||
|
|
||||||
|
# just copy all libs
|
||||||
|
cp -r ../libs ./
|
||||||
|
|
||||||
|
# compile memgraph
|
||||||
|
cd ../build
|
||||||
|
# rm -rf ./*
|
||||||
|
# cmake -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ -DCMAKE_BUILD_TYPE:String=debug ..
|
||||||
|
# make -j 4
|
||||||
|
|
||||||
|
# create dst directory
|
||||||
|
mkdir -p ../release/${exe_name}
|
||||||
|
|
||||||
|
# copy all relevant files
|
||||||
|
cp ${exe_name} ../release/${exe_name}/memgraph
|
||||||
|
cp libmemgraph_pic.a ../release/${exe_name}/libmemgraph_pic.a
|
||||||
|
cp -r include ../release/${exe_name}/include
|
||||||
|
cp -r template ../release/${exe_name}/template
|
||||||
|
mkdir -p ../release/${exe_name}/compiled/cpu
|
||||||
|
|
||||||
|
echo "Memgraph Release Building DONE"
|
||||||
|
|
||||||
|
|
@ -1,3 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
|
|
||||||
echo "TODO: build beta version of Memgraph"
|
|
@ -9,16 +9,16 @@ session = driver.session()
|
|||||||
queries = [];
|
queries = [];
|
||||||
|
|
||||||
queries.append((True, "CREATE (n {name: \"Max\", age: 21}) RETURN n"))
|
queries.append((True, "CREATE (n {name: \"Max\", age: 21}) RETURN n"))
|
||||||
queries.append((False, "CREATE (n {name: \"Paul\", age: 21}) RETURN n"))
|
queries.append((True, "CREATE (n {name: \"Paul\", age: 21}) RETURN n"))
|
||||||
queries.append((False, "CREATE (n:PERSON {name: \"Chris\", age: 20}) RETURN n"))
|
queries.append((True, "CREATE (n:PERSON {name: \"Chris\", age: 20}) RETURN n"))
|
||||||
queries.append((False, "CREATE (n:PERSON:STUDENT {name: \"Marko\", age: 19}) RETURN n"))
|
queries.append((True, "CREATE (n:PERSON:STUDENT {name: \"Marko\", age: 19}) RETURN n"))
|
||||||
queries.append((False, "CREATE (n:TEST {string: \"Properties test\", integer: 100, float: 232.2323, bool: True}) RETURN n"))
|
queries.append((True, "CREATE (n:TEST {string: \"Properties test\", integer: 100, float: 232.2323, bool: True}) RETURN n"))
|
||||||
|
|
||||||
queries.append((False, "MATCH (n) WHERE ID(n)=0 RETURN n"))
|
queries.append((True, "MATCH (n) WHERE ID(n)=0 RETURN n"))
|
||||||
queries.append((False, "MATCH (n) WHERE ID(n)=1 RETURN n"))
|
queries.append((True, "MATCH (n) WHERE ID(n)=1 RETURN n"))
|
||||||
queries.append((False, "MATCH (n) WHERE ID(n)=2 RETURN n"))
|
queries.append((True, "MATCH (n) WHERE ID(n)=2 RETURN n"))
|
||||||
queries.append((False, "MATCH (n) WHERE ID(n)=3 RETURN n"))
|
queries.append((True, "MATCH (n) WHERE ID(n)=3 RETURN n"))
|
||||||
queries.append((False, "MATCH (n) WHERE ID(n)=4 RETURN n"))
|
queries.append((True, "MATCH (n) WHERE ID(n)=4 RETURN n"))
|
||||||
|
|
||||||
queries.append((False, "MATCH (n1), (n2) WHERE ID(n1)=0 AND ID(n2)=1 CREATE (n1)-[r:IS]->(n2) RETURN r"))
|
queries.append((False, "MATCH (n1), (n2) WHERE ID(n1)=0 AND ID(n2)=1 CREATE (n1)-[r:IS]->(n2) RETURN r"))
|
||||||
queries.append((False, "MATCH (n1), (n2) WHERE ID(n1)=0 AND ID(n2)=1 CREATE (n1)-[r:IS {name: \"test\", age: 23}]->(n2) RETURN r"))
|
queries.append((False, "MATCH (n1), (n2) WHERE ID(n1)=0 AND ID(n2)=1 CREATE (n1)-[r:IS {name: \"test\", age: 23}]->(n2) RETURN r"))
|
||||||
@ -35,4 +35,5 @@ queries.append((False, "MATCH ()-[r]-() WHERE ID(r)=1 RETURN r"))
|
|||||||
|
|
||||||
for active, query in queries:
|
for active, query in queries:
|
||||||
if active:
|
if active:
|
||||||
session.run(query)
|
for record in session.run(query):
|
||||||
|
print(record)
|
||||||
|
@ -34,7 +34,7 @@ int main(void)
|
|||||||
// that are configured below
|
// that are configured below
|
||||||
std::set_terminate(&terminate_handler);
|
std::set_terminate(&terminate_handler);
|
||||||
|
|
||||||
logging::init_async();
|
logging::init_sync();
|
||||||
logging::log->pipe(std::make_unique<Stdout>());
|
logging::log->pipe(std::make_unique<Stdout>());
|
||||||
logger = logging::log->logger("Main");
|
logger = logging::log->logger("Main");
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user