diff --git a/backend/python/requirements.txt b/backend/python/requirements.txt index 69510ed..3f383ee 100644 --- a/backend/python/requirements.txt +++ b/backend/python/requirements.txt @@ -1,2 +1,2 @@ -kafka-python -gqlalchemy +kafka-python==2.0.2 +git+https://github.com/memgraph/gqlalchemy.git@add-create-stream diff --git a/memgraph/README.md b/memgraph/README.md index 26dcbfd..2f3e1c5 100644 --- a/memgraph/README.md +++ b/memgraph/README.md @@ -10,3 +10,8 @@ creates required indexes, constraints, and triggers. ```bash bash run.sh memgraph ``` + +## NOTES + +Memgraph transform script inside `query_modules` can NOT be called `kafka.py` +because of a conflict with the `KAFKA` clause. diff --git a/memgraph/gqlalchmey/main.py b/memgraph/gqlalchmey/main.py new file mode 100644 index 0000000..248c4f4 --- /dev/null +++ b/memgraph/gqlalchmey/main.py @@ -0,0 +1,4 @@ +from gqlalchemy import Memgraph + +if __name__ == "__main__": + pass diff --git a/memgraph/gqlalchmey/requirements.txt b/memgraph/gqlalchmey/requirements.txt new file mode 100644 index 0000000..97a244a --- /dev/null +++ b/memgraph/gqlalchmey/requirements.txt @@ -0,0 +1 @@ +git+https://github.com/memgraph/gqlalchemy.git@add-create-stream diff --git a/memgraph/queries/create_stream.cypher b/memgraph/queries/create_stream.cypher index deeea17..17c57f9 100644 --- a/memgraph/queries/create_stream.cypher +++ b/memgraph/queries/create_stream.cypher @@ -1 +1 @@ -CREATE STREAM kafkaStream TOPICS topic TRANSFORM kafka.transform; +CREATE KAFKA STREAM kafkaStream TOPICS topic TRANSFORM kafka_stream.transform; diff --git a/memgraph/query_modules/kafka.py b/memgraph/query_modules/kafka_stream.py similarity index 100% rename from memgraph/query_modules/kafka.py rename to memgraph/query_modules/kafka_stream.py diff --git a/memgraph/run.sh b/memgraph/run.sh index 2442661..1eff64f 100755 --- a/memgraph/run.sh +++ b/memgraph/run.sh @@ -11,6 +11,7 @@ script_help_and_exit () { echo " action - takes a filename (excluding the extension) from the" echo " queries directory. The file contains a query that will" echo " be executed in the running Memgraph instance" + echo " init_gqlalchemy - initializes Memgraph using GQLAlchmey" exit 1 } @@ -83,6 +84,10 @@ case "$action" in init ;; + init_gqlalchemy) + python3 gqlalchmey/main.py + ;; + drop) drop ;;