diff --git a/.gitignore b/.gitignore index 64d968ef72..3cf16180f3 100644 --- a/.gitignore +++ b/.gitignore @@ -67,6 +67,7 @@ build *.ttl release/doc/*.html src/restful/server/resource/ +src/restful/server/browser-resource/ src/server/restful/server/resource/ .idea .code-workspace diff --git a/ci/images/tugraph-compile-centos7-Dockerfile b/ci/images/tugraph-compile-centos7-Dockerfile index 556b6f0016..d1db643fcd 100644 --- a/ci/images/tugraph-compile-centos7-Dockerfile +++ b/ci/images/tugraph-compile-centos7-Dockerfile @@ -34,13 +34,12 @@ RUN yum -x filesystem update -y && yum install -y \ automake \ libtoolize \ texinfo \ - java-1.8.0-openjdk* \ perl-Digest-MD5 \ libcurl-devel.x86_64 \ kde-l10n-Chinese \ glibc-common \ which \ - java-11-openjdk-devel + java-11-openjdk-devel && yum clean all # install g++ 8.4.0 # if it is not accessible, replace it with the link below diff --git a/ci/images/tugraph-compile-centos8-Dockerfile b/ci/images/tugraph-compile-centos8-Dockerfile index 407c77ecf1..2e739836d6 100644 --- a/ci/images/tugraph-compile-centos8-Dockerfile +++ b/ci/images/tugraph-compile-centos8-Dockerfile @@ -32,13 +32,12 @@ RUN yum update -y && yum install -y \ automake \ perl-Digest-MD5 \ perl.x86_64 \ - java-1.8.0-openjdk* \ libcurl-devel.x86_64 \ glibc-common \ langpacks-zh_CN \ which \ java-11-openjdk-devel \ - openssh-server + openssh-server && yum clean all RUN rm /run/nologin && rm /usr/sbin/nologin diff --git a/ci/images/tugraph-compile-ubuntu18.04-Dockerfile b/ci/images/tugraph-compile-ubuntu18.04-Dockerfile index 3a9926c16b..6f4bcdd3e9 100644 --- a/ci/images/tugraph-compile-ubuntu18.04-Dockerfile +++ b/ci/images/tugraph-compile-ubuntu18.04-Dockerfile @@ -37,7 +37,6 @@ RUN apt-get update && apt-get install -y \ libjson-perl \ libperlio-gzip-perl \ libdigest-perl-md5-perl \ - openjdk-8-jdk \ language-pack-zh* \ openjdk-11-jdk diff --git a/ci/images/tugraph-mini-runtime-centos7-Dockerfile b/ci/images/tugraph-mini-runtime-centos7-Dockerfile index f79b8c334b..91b1c34b9b 100644 --- a/ci/images/tugraph-mini-runtime-centos7-Dockerfile +++ b/ci/images/tugraph-mini-runtime-centos7-Dockerfile @@ -24,7 +24,4 @@ RUN rpm -ivh ${FILENAME} && rm /${FILENAME} ENV LD_LIBRARY_PATH=/usr/local/lib64:/usr/local/lib:$LD_LIBRARY_PATH -# set locale -RUN localedef -c -f UTF-8 -i zh_CN zh_CN.utf8 -ENV LANG zh_CN.utf8 -ENV LC_ALL zh_CN.utf8 +CMD ["lgraph_server -d start"] \ No newline at end of file diff --git a/ci/images/tugraph-mini-runtime-centos8-Dockerfile b/ci/images/tugraph-mini-runtime-centos8-Dockerfile index ae52fbc9f2..f22e2a253f 100644 --- a/ci/images/tugraph-mini-runtime-centos8-Dockerfile +++ b/ci/images/tugraph-mini-runtime-centos8-Dockerfile @@ -22,6 +22,4 @@ RUN rpm -ivh ${FILENAME} && rm /${FILENAME} ENV LD_LIBRARY_PATH=/usr/local/lib64:/usr/local/lib:$LD_LIBRARY_PATH -# set locale -ENV LANG zh_CN.utf8 -ENV LC_ALL zh_CN.utf8 +CMD ["lgraph_server -d start"] \ No newline at end of file diff --git a/ci/images/tugraph-mini-runtime-ubuntu18.04-Dockerfile b/ci/images/tugraph-mini-runtime-ubuntu18.04-Dockerfile index 51de3c2acf..65fe641f30 100644 --- a/ci/images/tugraph-mini-runtime-ubuntu18.04-Dockerfile +++ b/ci/images/tugraph-mini-runtime-ubuntu18.04-Dockerfile @@ -23,6 +23,3 @@ RUN wget ${FILEPATH}/${FILENAME} RUN dpkg -i ${FILENAME} && rm /${FILENAME} ENV LD_LIBRARY_PATH=/usr/local/lib64:/usr/local/lib:$LD_LIBRARY_PATH - -ENV LANG zh_CN.UTF-8 -ENV LC_ALL zh_CN.UTF-8 diff --git a/ci/images/tugraph-runtime-arm64v8-centos7-Dockerfile b/ci/images/tugraph-runtime-arm64v8-centos7-Dockerfile index 0d616b5764..21321acf0a 100644 --- a/ci/images/tugraph-runtime-arm64v8-centos7-Dockerfile +++ b/ci/images/tugraph-runtime-arm64v8-centos7-Dockerfile @@ -108,7 +108,3 @@ ENV JAVA_HOME=/usr/lib/jvm/java-1.8.0-openjdk/jre/ \ PYTHONPATH=/usr/local/lib64:$PYTHONPATH \ PATH=/opt/apache-maven-3.8.7/bin:$PATH -# set locale -RUN localedef -c -f UTF-8 -i zh_CN zh_CN.utf8 -ENV LANG zh_CN.utf8 -ENV LC_ALL zh_CN.utf8 diff --git a/ci/images/tugraph-runtime-centos7-Dockerfile b/ci/images/tugraph-runtime-centos7-Dockerfile index 99510b1a17..f63c6a569d 100644 --- a/ci/images/tugraph-runtime-centos7-Dockerfile +++ b/ci/images/tugraph-runtime-centos7-Dockerfile @@ -18,7 +18,7 @@ RUN yum -x filesystem update -y && yum install -y \ bzip2 \ unzip \ openssl-static \ - libcurl-devel.x86_64 + libcurl-devel.x86_64 && yum clean all # install g++ 8.4.0 # if it is not accessible, replace it with the link below @@ -66,8 +66,9 @@ RUN wget https://tugraph-web.oss-cn-beijing.aliyuncs.com/tugraph/deps/boost_1_68 ARG FILEPATH # specifies installation package name for tugraph ARG FILENAME -RUN wget ${FILEPATH}/${FILENAME} -RUN rpm -ivh ${FILENAME} && rm /${FILENAME} +RUN wget ${FILEPATH}/${FILENAME} && rpm -ivh ${FILENAME} && rm -f /${FILENAME} ENV LD_LIBRARY_PATH=/usr/local/lib64:$LD_LIBRARY_PATH \ PYTHONPATH=/usr/local/lib64:$PYTHONPATH + +CMD ["lgraph_server -d start"] diff --git a/ci/images/tugraph-runtime-centos8-Dockerfile b/ci/images/tugraph-runtime-centos8-Dockerfile index 349a3164d0..ced2316412 100644 --- a/ci/images/tugraph-runtime-centos8-Dockerfile +++ b/ci/images/tugraph-runtime-centos8-Dockerfile @@ -16,7 +16,7 @@ RUN yum update -y && yum install -y \ bzip2 \ unzip \ openssl-devel.x86_64 \ - libcurl-devel.x86_64 + libcurl-devel.x86_64 && yum clean all # install g++ 8.4.0 # if it is not accessible, replace it with the link below @@ -64,8 +64,9 @@ RUN wget https://tugraph-web.oss-cn-beijing.aliyuncs.com/tugraph/deps/boost_1_68 ARG FILEPATH # specifies installation package name for tugraph ARG FILENAME -RUN wget ${FILEPATH}/${FILENAME} -RUN rpm -ivh ${FILENAME} && rm /${FILENAME} +RUN wget ${FILEPATH}/${FILENAME} && rpm -ivh ${FILENAME} && rm -f /${FILENAME} ENV LD_LIBRARY_PATH=/usr/local/lib64:/usr/local/lib:$LD_LIBRARY_PATH \ PYTHONPATH=/usr/local/lib64:$PYTHONPATH + +CMD ["lgraph_server -d start"] \ No newline at end of file diff --git a/ci/images/tugraph-runtime-ubuntu18.04-Dockerfile b/ci/images/tugraph-runtime-ubuntu18.04-Dockerfile index bcfcdd31e0..00cf5b92af 100644 --- a/ci/images/tugraph-runtime-ubuntu18.04-Dockerfile +++ b/ci/images/tugraph-runtime-ubuntu18.04-Dockerfile @@ -115,5 +115,3 @@ ENV JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64/jre \ PYTHONPATH=/usr/local/lib64:$PYTHONPATH \ PATH=/opt/apache-maven-3.8.7/bin:/usr/lib/jvm/java-8-openjdk-amd64/jre/bin:$PATH -ENV LANG zh_CN.UTF-8 -ENV LC_ALL zh_CN.UTF-8 diff --git a/deps/build_deps.sh b/deps/build_deps.sh index 200d694a0f..5640e4edaf 100755 --- a/deps/build_deps.sh +++ b/deps/build_deps.sh @@ -10,5 +10,19 @@ npm run lint -- --fix npm run build RESOURCE_DIR=${SCRIPT_DIR}/../src/restful/server/resource/ rm -rf ${RESOURCE_DIR} +rm -rf dist/scene_data cp -r dist ${RESOURCE_DIR} -cd - +cd .. + +echo "======================================" +echo "Building tugraph-db-browser" +echo "======================================" + +cd tugraph-db-browser +yarn bootstrap +rm -rf client/dist +yarn build +BROWSER_RESOURCE_DIR=${SCRIPT_DIR}/../src/restful/server/browser-resource +rm -rf ${BROWSER_RESOURCE_DIR} +cp -r client/dist/resource ${BROWSER_RESOURCE_DIR} +cp -r client/src/constants/demo_data ${BROWSER_RESOURCE_DIR}/ diff --git a/deps/tugraph-db-browser b/deps/tugraph-db-browser index e384b40fc3..a6264fd812 160000 --- a/deps/tugraph-db-browser +++ b/deps/tugraph-db-browser @@ -1 +1 @@ -Subproject commit e384b40fc3ef556d7cde3330055865534263875d +Subproject commit a6264fd812f67cbeb831ce4219c6a22b04a23fdf diff --git a/release/local/etc/lgraph.json b/release/local/etc/lgraph.json index 273398fb37..196a97d1e3 100644 --- a/release/local/etc/lgraph.json +++ b/release/local/etc/lgraph.json @@ -12,5 +12,5 @@ "ssl_auth" : false, "server_key" : "/usr/local/etc/lgraph/server-key.pem", "server_cert" : "/usr/local/etc/lgraph/server-cert.pem", - "web" : "/usr/local/share/lgraph/resource" + "web" : "/usr/local/share/lgraph/browser-resource" } diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index dc07551858..6415924b0e 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -14,14 +14,14 @@ include(BuildClients.cmake) include(BuildCythonExtension.cmake) include(BuildBoltLib.cmake) -install(TARGETS lgraph lgraph_python_api lgraph_server lgraph_client_python lgraph_db_python +install(TARGETS lgraph lgraph_python_api lgraph_server lgraph_db_python RUNTIME DESTINATION bin LIBRARY DESTINATION lib64) install(DIRECTORY ${CMAKE_CURRENT_LIST_DIR}/restful/server/resource DESTINATION share/lgraph) install(DIRECTORY - ${CMAKE_CURRENT_LIST_DIR}/../deps/tugraph-db-browser + ${CMAKE_CURRENT_LIST_DIR}/restful/server/browser-resource DESTINATION share/lgraph) # install procedure demos install(DIRECTORY @@ -31,6 +31,13 @@ install(FILES ${CMAKE_CURRENT_LIST_DIR}/../procedures/demo/v2_pagerank.cpp ${CMAKE_CURRENT_LIST_DIR}/../procedures/demo/scan_graph.py DESTINATION share/lgraph/resource/procedure_demo/) +install(DIRECTORY + DESTINATION share/lgraph/browser-resource/procedure_demo/) +install(FILES + ${CMAKE_CURRENT_LIST_DIR}/../procedures/demo/v1_scan_graph.cpp + ${CMAKE_CURRENT_LIST_DIR}/../procedures/demo/v2_pagerank.cpp + ${CMAKE_CURRENT_LIST_DIR}/../procedures/demo/scan_graph.py + DESTINATION share/lgraph/browser-resource/procedure_demo/) install(FILES ${CMAKE_CURRENT_LIST_DIR}/python/lgraph_task_runner.py DESTINATION bin) @@ -54,13 +61,13 @@ add_custom_command(TARGET lgraph_server add_custom_command(TARGET lgraph_server POST_BUILD COMMAND ${CMAKE_COMMAND} -E create_symlink - ${CMAKE_CURRENT_LIST_DIR}/restful/server/resource + ${CMAKE_CURRENT_LIST_DIR}/restful/server/browser-resource ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/resource) -add_custom_command(TARGET lgraph_server - POST_BUILD - COMMAND ${CMAKE_COMMAND} -E copy_directory - ${CMAKE_CURRENT_LIST_DIR}/../procedures/demo/ - ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/resource/procedure_demo/) +#add_custom_command(TARGET lgraph_server +# POST_BUILD +# COMMAND ${CMAKE_COMMAND} -E copy_directory +# ${CMAKE_CURRENT_LIST_DIR}/../procedures/demo/ +# ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/resource/procedure_demo/) add_custom_command(TARGET lgraph_server POST_BUILD COMMAND ${CMAKE_COMMAND} -E create_symlink diff --git a/src/bolt/pack_stream.h b/src/bolt/pack_stream.h index 1269519326..e16f5eef69 100644 --- a/src/bolt/pack_stream.h +++ b/src/bolt/pack_stream.h @@ -79,9 +79,12 @@ class PackStream { } void PackDate(const bolt::Date& m) { + packer_.StructHeader('D', 1); packer_.Int64(m.days); } - void PackLocalTime(const bolt::LocalTime& m) { + void PackLocalDateTime(const bolt::LocalDateTime& m) { + packer_.StructHeader('d', 2); + packer_.Int64(m.seconds); packer_.Int64(m.nanoseconds); } @@ -123,8 +126,8 @@ class PackStream { PackList(std::any_cast&>(x)); } else if (type == typeid(bolt::Date)) { PackDate(std::any_cast(x)); - } else if (type == typeid(bolt::LocalTime)) { - PackLocalTime(std::any_cast(x)); + } else if (type == typeid(bolt::LocalDateTime)) { + PackLocalDateTime(std::any_cast(x)); } else { LOG_FATAL() << FMA_FMT("PackX meet unexpected type {}", type.name()); } diff --git a/src/bolt/to_string.h b/src/bolt/to_string.h index f4b05516c2..adab89e1ae 100644 --- a/src/bolt/to_string.h +++ b/src/bolt/to_string.h @@ -19,6 +19,7 @@ #include "tools/lgraph_log.h" #include "bolt/record.h" #include "bolt/graph.h" +#include "lgraph/lgraph_date_time.h" #pragma once namespace bolt { @@ -53,10 +54,13 @@ nlohmann::json ToJsonObj(const std::any& item) { return ToJsonObj(path); } else if (item.type() == typeid(bolt::Date)) { const auto& date = std::any_cast(item); - return ToJsonObj(date.days); - } else if (item.type() == typeid(bolt::LocalTime)) { - const auto& localTime = std::any_cast(item); - return ToJsonObj(localTime.nanoseconds); + lgraph_api::Date d(date.days); + return ToJsonObj(d.ToString()); + } else if (item.type() == typeid(bolt::LocalDateTime)) { + const auto& localDateTime = std::any_cast(item); + lgraph_api::DateTime dateTime( + localDateTime.seconds * 1000000 + localDateTime.nanoseconds/1000); + return ToJsonObj(dateTime.ToString()); } else if (item.type() == typeid(std::vector)) { const auto& vector = std::any_cast&>(item); nlohmann::json ret = nlohmann::json::array(); diff --git a/src/cypher/procedure/procedure.cpp b/src/cypher/procedure/procedure.cpp index 80b58cb401..a585e29e0c 100644 --- a/src/cypher/procedure/procedure.cpp +++ b/src/cypher/procedure/procedure.cpp @@ -30,6 +30,7 @@ #include "cypher/monitor/memory_monitor_allocator.h" #include "fma-common/encrypt.h" #include "import/import_v3.h" +#include "server/bolt_session.h" namespace cypher { @@ -1646,6 +1647,25 @@ void BuiltinProcedure::DbmsMetaRefreshCount(RTContext *ctx, const Record *record ac_db.RefreshCount(); } +void BuiltinProcedure::DbmsSecurityIsDefaultUserPassword(RTContext *ctx, + const cypher::Record *record, + const cypher::VEC_EXPR &args, + const cypher::VEC_STR &yield_items, + std::vector *records) { + CYPHER_ARG_CHECK( + args.size() == 0, + "need 0 parameters, e.g. dbms.security.isDefaultUserPassword()") + if (ctx->txn_) ctx->txn_->Abort(); + bool is_default_user_password = false; + if (ctx->bolt_conn_) { + auto session = (bolt::BoltSession*)(ctx->bolt_conn_->GetContext()); + is_default_user_password = session->using_default_user_password; + } + Record r; + r.AddConstant(lgraph::FieldData(is_default_user_password)); + records->emplace_back(r.Snapshot()); +} + void BuiltinProcedure::DbmsSecurityChangePassword(RTContext *ctx, const cypher::Record *record, const cypher::VEC_EXPR &args, const cypher::VEC_STR &yield_items, diff --git a/src/cypher/procedure/procedure.h b/src/cypher/procedure/procedure.h index 03d44cd91e..98d2698e98 100644 --- a/src/cypher/procedure/procedure.h +++ b/src/cypher/procedure/procedure.h @@ -183,6 +183,10 @@ class BuiltinProcedure { static void DbmsMetaRefreshCount(RTContext *ctx, const Record *record, const VEC_EXPR &args, const VEC_STR &yield_items, std::vector *records); + static void DbmsSecurityIsDefaultUserPassword(RTContext *ctx, const Record *record, + const VEC_EXPR &args, const VEC_STR &yield_items, + std::vector *records); + static void DbmsSecurityChangePassword(RTContext *ctx, const Record *record, const VEC_EXPR &args, const VEC_STR &yield_items, std::vector *records); @@ -728,6 +732,12 @@ static std::vector global_procedures = { Procedure("dbms.meta.refreshCount", BuiltinProcedure::DbmsMetaRefreshCount, Procedure::SIG_SPEC{}, Procedure::SIG_SPEC{{"", {0, lgraph_api::LGraphType::NUL}}}, false, true), + Procedure("dbms.security.isDefaultUserPassword", + BuiltinProcedure::DbmsSecurityIsDefaultUserPassword, + Procedure::SIG_SPEC{}, + Procedure::SIG_SPEC{ + {"isDefaultUserPassword", {0, lgraph_api::LGraphType::BOOLEAN}} + }, true, false), Procedure("dbms.security.changePassword", BuiltinProcedure::DbmsSecurityChangePassword, Procedure::SIG_SPEC{ {"current_password", {0, lgraph_api::LGraphType::STRING}}, diff --git a/src/lgraph_api/lgraph_types.cpp b/src/lgraph_api/lgraph_types.cpp index dc499c820c..b9679342f2 100644 --- a/src/lgraph_api/lgraph_types.cpp +++ b/src/lgraph_api/lgraph_types.cpp @@ -42,8 +42,11 @@ std::any FieldData::ToBolt() const { return *data.buf; case FieldType::DATE: return bolt::Date{data.int32}; - case FieldType::DATETIME: - return bolt::LocalTime({data.int64 * 1000}); + case FieldType::DATETIME: { + int64_t sec = data.int64 / 1000000; + int64_t micro = data.int64 % 1000000; + return bolt::LocalDateTime{sec, micro*1000}; + } default: throw std::runtime_error("ToBolt meet unsupported data type."); } diff --git a/src/server/bolt_handler.cpp b/src/server/bolt_handler.cpp index 50116a2d6a..63521da396 100644 --- a/src/server/bolt_handler.cpp +++ b/src/server/bolt_handler.cpp @@ -225,6 +225,10 @@ std::functionpython_driver = true; } } + if (principal == lgraph::_detail::DEFAULT_ADMIN_NAME && + credentials == lgraph::_detail::DEFAULT_ADMIN_PASS) { + session->using_default_user_password = true; + } session->state = SessionState::READY; session->user = principal; session->fsm_thread = std::thread(BoltFSM, conn.shared_from_this()); diff --git a/src/server/bolt_session.h b/src/server/bolt_session.h index 0615565a89..cbc412c4f1 100644 --- a/src/server/bolt_session.h +++ b/src/server/bolt_session.h @@ -46,6 +46,7 @@ struct BoltSession { BlockingQueue msgs; std::thread fsm_thread; bool python_driver = false; + bool using_default_user_password = false; }; } // namespace bolt diff --git a/test/integration/test_ha_procedure.py b/test/integration/test_ha_procedure.py index 87024722df..50c3591ff7 100644 --- a/test/integration/test_ha_procedure.py +++ b/test/integration/test_ha_procedure.py @@ -503,7 +503,7 @@ def test_procedure(self): procedures = json.loads(ret[1]) #TODO when this assert failed , you should add the additional procedure test code or remove the deleted procedure test code log.info("procedures count : %s", len(procedures)) - assert len(procedures) == 103 + assert len(procedures) == 104 ha_client.logout() def test_graph(self): diff --git a/test/integration/test_procedure.py b/test/integration/test_procedure.py index 276b045f16..d4d2e2f85d 100644 --- a/test/integration/test_procedure.py +++ b/test/integration/test_procedure.py @@ -471,7 +471,7 @@ def test_procedure(self, server, client): procedures = json.loads(ret[1]) #TODO when this assert failed , you should add the additional procedure test code or remove the deleted procedure test code log.info("procedures count : %s", len(procedures)) - assert len(procedures) == 103 + assert len(procedures) == 104 @pytest.mark.parametrize("server", [SERVEROPT], indirect=True) diff --git a/test/test_lgraph_cli.cpp b/test/test_lgraph_cli.cpp index 2e9d042ce5..278f7ef917 100644 --- a/test/test_lgraph_cli.cpp +++ b/test/test_lgraph_cli.cpp @@ -100,7 +100,7 @@ created 2 vertices, created 0 edges. created 0 vertices, created 1 edges. n -(:person {int16:16,float:1.11,double:100.98,int8:8,string:"foo bar",int32:32,int64:64,bool:true,datetime:1493632800000000000,date:17289}) +(:person {int16:16,float:1.11,double:100.98,int8:8,string:"foo bar",int32:32,int64:64,bool:true,datetime:"2017-05-01 10:00:00",date:"2017-05-03"}) @plan ReadOnly:1 Execution Plan: @@ -121,7 +121,7 @@ Symbol: [m] type(NODE), scope(LOCAL), symbol_id(2) Symbol: [r] type(RELATIONSHIP), scope(LOCAL), symbol_id(1) p -(:person {int16:16,float:1.11,double:100.98,int8:8,string:"foo bar",int32:32,int64:64,bool:true,datetime:1493632800000000000,date:17289})-[:is_friend {message:"hi.."}]->(:person {int16:116,float:11.11,double:1100.98,int8:18,string:"bar foo",int32:132,int64:164,bool:true,datetime:1525168800000000000,date:17654}) +(:person {int16:16,float:1.11,double:100.98,int8:8,string:"foo bar",int32:32,int64:64,bool:true,datetime:"2017-05-01 10:00:00",date:"2017-05-03"})-[:is_friend {message:"hi.."}]->(:person {int16:116,float:11.11,double:1100.98,int8:18,string:"bar foo",int32:132,int64:164,bool:true,datetime:"2018-05-01 10:00:00",date:"2018-05-03"}) )"; WriteFile(file, statements); @@ -155,7 +155,7 @@ p [""] ["created 0 vertices, created 1 edges."] ["n"] -["(:person {int16:16,float:1.11,double:100.98,int8:8,string:\"foo bar\",int32:32,int64:64,bool:true,datetime:1493632800000000000,date:17289})"] +["(:person {int16:16,float:1.11,double:100.98,int8:8,string:\"foo bar\",int32:32,int64:64,bool:true,datetime:\"2017-05-01 10:00:00\",date:\"2017-05-03\"})"] ["@plan"] ["ReadOnly:1\nExecution Plan:\nProduce Results\n Project [n]\n Expand(All) [n --> m ]\n All Node Scan [n]\n"] ["r"] @@ -163,7 +163,7 @@ p ["@profile"] ["Current Pattern Graph:\nN[0] n: (MATCHED)\nN[1] m: (MATCHED)\nR[0 --> 1] r:{<0>: } (MATCHED)\nSymbol: [n] type(NODE), scope(LOCAL), symbol_id(0)\nSymbol: [m] type(NODE), scope(LOCAL), symbol_id(2)\nSymbol: [r] type(RELATIONSHIP), scope(LOCAL), symbol_id(1)\n"] ["p"] -["(:person {int16:16,float:1.11,double:100.98,int8:8,string:\"foo bar\",int32:32,int64:64,bool:true,datetime:1493632800000000000,date:17289})-[:is_friend {message:\"hi..\"}]->(:person {int16:116,float:11.11,double:1100.98,int8:18,string:\"bar foo\",int32:132,int64:164,bool:true,datetime:1525168800000000000,date:17654})"] +["(:person {int16:16,float:1.11,double:100.98,int8:8,string:\"foo bar\",int32:32,int64:64,bool:true,datetime:\"2017-05-01 10:00:00\",date:\"2017-05-03\"})-[:is_friend {message:\"hi..\"}]->(:person {int16:116,float:11.11,double:1100.98,int8:18,string:\"bar foo\",int32:132,int64:164,bool:true,datetime:\"2018-05-01 10:00:00\",date:\"2018-05-03\"})"] )xx"; WriteFile(file, statements); @@ -218,11 +218,11 @@ p 1 rows -+-------------------------------------------------------------------------------------------------------------------------------------------+ -| n | -+-------------------------------------------------------------------------------------------------------------------------------------------+ -| (:person {int16:16,float:1.11,double:100.98,int8:8,string:"foo bar",int32:32,int64:64,bool:true,datetime:1493632800000000000,date:17289}) | -+-------------------------------------------------------------------------------------------------------------------------------------------+ ++----------------------------------------------------------------------------------------------------------------------------------------------------+ +| n | ++----------------------------------------------------------------------------------------------------------------------------------------------------+ +| (:person {int16:16,float:1.11,double:100.98,int8:8,string:"foo bar",int32:32,int64:64,bool:true,datetime:"2017-05-01 10:00:00",date:"2017-05-03"}) | ++----------------------------------------------------------------------------------------------------------------------------------------------------+ 1 rows @@ -261,11 +261,11 @@ p 1 rows -+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| p | -+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| (:person {int16:16,float:1.11,double:100.98,int8:8,string:"foo bar",int32:32,int64:64,bool:true,datetime:1493632800000000000,date:17289})-[:is_friend {message:"hi.."}]->(:person {int16:116,float:11.11,double:1100.98,int8:18,string:"bar foo",int32:132,int64:164,bool:true,datetime:1525168800000000000,date:17654}) | -+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ ++--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| p | ++--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| (:person {int16:16,float:1.11,double:100.98,int8:8,string:"foo bar",int32:32,int64:64,bool:true,datetime:"2017-05-01 10:00:00",date:"2017-05-03"})-[:is_friend {message:"hi.."}]->(:person {int16:116,float:11.11,double:1100.98,int8:18,string:"bar foo",int32:132,int64:164,bool:true,datetime:"2018-05-01 10:00:00",date:"2018-05-03"}) | ++--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ 1 rows diff --git a/toolkits/CMakeLists.txt b/toolkits/CMakeLists.txt index 780ed97cf7..10a8e274e0 100644 --- a/toolkits/CMakeLists.txt +++ b/toolkits/CMakeLists.txt @@ -49,7 +49,7 @@ target_link_libraries(${TARGET_LGRAPH_BACKUP} lgraph_server_lib) ############### lgraph_cli ###################### set(TARGET_LGRAPH_CLI lgraph_cli) -add_executable(${TARGET_LGRAPH_CLI} lgraph_cli.cpp ${LGRAPH_ROOT_DIR}/toolkits/linenoise/linenoise.c) +add_executable(${TARGET_LGRAPH_CLI} lgraph_cli.cpp ${LGRAPH_ROOT_DIR}/src/core/lgraph_date_time.cpp ${LGRAPH_ROOT_DIR}/toolkits/linenoise/linenoise.c) target_link_libraries(${TARGET_LGRAPH_CLI} bolt ${Boost_LIBRARIES}) ############### lgraph_warmup ###################