Commit Graph

256 Commits

Author SHA1 Message Date
Josipmrden
eb22edfd35
Add any type to C++ mgp wrapper 2023-06-20 09:33:14 +02:00
Andi
029be10f1d
Add queries to show or terminate active transactions (#790) 2023-03-27 15:46:00 +02:00
Ante Pušić
97d45ab1d8
Add Python query module API mock (#757) 2023-03-07 15:41:19 +01:00
Ante Pušić
aad4bcb7a0
Fix C++ API memory leak on Relationships() (#743) 2023-01-25 17:23:46 +01:00
Antonio Filipovic
1cd1da84fd
Fix bug on (vertex|edge) properties in C++ API (#732) 2023-01-23 12:57:17 +01:00
Ante Javor
d72e7fa38d
Fix mgp.py create edge type hint and comment (#724) 2022-12-23 10:08:52 +01:00
Ante Pušić
45451bae3b
Fix C++ query modules API bugs (#688) 2022-12-06 16:57:50 +01:00
Boris Taševski
a0b8871b36
Fix cland tidy errors and other warning (#555) 2022-09-15 15:51:35 +02:00
Marko Budiselic
bb6cf35441 Merge master cpp module API 2022-09-15 11:29:52 +02:00
Ante Pušić
5bc301d21d
Add C++ query modules API (#546)
Co-authored-by: Ante Pusic <ante.pusic@memgraph.com>
Co-authored-by: Josip Mrden <josip.mrden@memgraph.com>
2022-09-15 11:26:26 +02:00
Boris Taševski
c09b175c76
[E129-MG < T1006-MG] Expand C API with LBA checks (#527)
* [T1006-MG < T1017-MG] Add LBA checks to all read procedures in C API (#515)

* Initial Impl

* NextPermittedEdge introduced

* revert moving constructor to cpp

* edge from and edge to methods expanded with lba check

* minor fix

* added check to path expand procedure

* Added integration tests for read query procedures

* additional check

* changed iterator type to reference

* comments from pr

Co-authored-by: Josip Mrden <josip.mrden@memgraph.io>

* [T1006-MG < T1018-MG] Add LBA checks to all update procedures in C API (#516)

* Initial Impl

* NextPermittedEdge introduced

* revert moving constructor to cpp

* edge from and edge to methods expanded with lba check

* minor fix

* extended update methods

* added check to path expand procedure

* Added integration tests for read query procedures

* Added integration tests for update query modules

* additional check

* changed iterator type to reference

* fixed bug in Update property for node; fixed 2 e2e tests

* replaced enum

Co-authored-by: Josip Mrden <josip.mrden@memgraph.io>

* [T1006-MG < T1019-MG] Add LBA checks to all Create and Delete procedures in C API (#517)

* Initial Impl

* NextPermittedEdge introduced

* revert moving constructor to cpp

* edge from and edge to methods expanded with lba check

* minor fix

* extended update methods

* initial implementation

* added check to path expand procedure

* Added integration tests for read query procedures

* Added integration tests for update query modules

* Added unit tests for creation of vertex, adding and removing vertex label

* additional check

* changed iterator type to reference

* Added unit tests for create edge

* Corrected query module in create edge

* fixed bug in Update property for node; fixed 2 e2e tests

* fixed merge errors

* Expanded FineGrainedAuthChecker with HasGlobalPermissionOnVertices and HasGlobalPermissionOnEdges

* Removed two wrong checks; Added two global checks

* return null added

* introduced new mgp_error value

* fixed endless loop

* replaced enum

* intermediate

* tests updated

* PermissionDeniedError -> AuthorizationError rename

* rename in enum permission_denied error -> authorization error

* mgp_vertex_remove_label check improved

* quotes changed; order of imports fixed

* string constant introduced

* import fixed

* yaml format

Co-authored-by: Josip Mrden <josip.mrden@memgraph.io>

Co-authored-by: Josip Mrden <josip.mrden@memgraph.io>
2022-09-08 17:48:34 +02:00
antoniofilipovic
d73d153978
Add logging API (#417) 2022-08-22 14:47:52 +03:00
János Benjamin Antal
05b00edfd4
Declare mgp_func_context outside the callback function (#481) 2022-08-03 15:15:53 +02:00
Jure Bajic
3dd2657320
Create mgp python package (#433) 2022-07-12 10:54:23 +02:00
Ante Javor
86b1688192
Rewrite Python API comments and snippets (#420)
* Update comments
2022-07-07 15:05:56 +02:00
János Benjamin Antal
8059a3e653
Improve magic functions docs (#391)
* Improve documentation of magic functions

* Improve wording for decorators
2022-05-17 15:33:28 +02:00
Jeremy B
10ea9c773e
Making mgp_error enum class when compiling c++. Remains enum when com… (#389)
* Making mgp_error enum class when compiling c++. Remains enum when compiling c.
2022-05-05 17:48:17 +02:00
Josip Matak
4abaf27765
Memgraph magic functions (#345)
* Extend mgp_module with include adding functions

* Add return type to the function API

* Change Cypher grammar

* Add Python support for functions

* Implement error handling

* E2e tests for functions

* Write cpp e2e functions

* Create mg.functions() procedure

* Implement case insensitivity for user-defined Magic Functions.
2022-04-21 15:45:31 +02:00
Antonio Andelic
12f4e0068a Small polishing and fixes 2021-11-16 17:23:20 +01:00
Antonio Andelic
e8976e0f1c Update mgp API for Pulsar (#298) 2021-11-16 16:00:25 +01:00
Kostas Kyrimis
47c0c629c7
Add procedure for setting a kafka stream offset (#282) 2021-11-11 12:07:58 +01:00
Antonio Andelic
e9a937ad6d
Update license headers and change date (#270) 2021-10-13 10:06:07 +02:00
Jure Bajic
9e678f8cbe Add new memgraph licenses and move third party licenses (#248) 2021-10-03 12:26:48 +02:00
antonio2368
69e4f1784b
Small polishing for Release workflow (#250) 2021-10-03 11:09:57 +02:00
antonio2368
0a23eb11ae Define procedure API for temporal types (#229) 2021-10-02 15:30:34 +02:00
János Benjamin Antal
ccca46370d Fix RWTypeChecker and some small improvements (#247)
* Fix doc of mgp_graph_vertices

* Make write_proc example meaningful write procedure example

* Improve wrap_exceptions

* Add check for write procedures for ReadWriteTypeChecker

* Change error code in case of invalid default value for optional arguments
2021-10-02 13:18:37 +02:00
János Benjamin Antal
e33fa5f9c0 Add example write procedure (#244) 2021-10-02 13:18:37 +02:00
János Benjamin Antal
721eefe263 Handle write procedures in queries and update docs of properties iterator (#238) 2021-10-02 13:18:36 +02:00
János Benjamin Antal
be9ed7e879 Python wrapper for write procedures (#234)
* Rename mgp_graph_remove to mgp_graph_delete

* Add mgp_graph_detach_delete

* Add PyGraph functions

* Add _mgp exceptions

* Use unified error handling in python wrapper

* Ignore clang-tidy warnings

* Add mgp.Graph, mgp.Vertex and mgp.Edge mutable functions

* Add python write procedure registration

* Add `is_write` result field to mg.procedures

* Use storage::View::NEW for write procedures

* Add simple tests for write procedures

* Remove false information about IDs
2021-10-02 13:17:41 +02:00
Benjamin Antal
482798295e Add write procedures 2021-10-02 13:17:41 +02:00
János Benjamin Antal
2afc1b99f6
New MGP API (#219) 2021-09-09 10:44:47 +02:00
antonio2368
ae280fd8db
Polishing and fixes (#196)
* Remove SHOW from Memgraph lexer

* Change get_payload to payload
2021-07-07 18:04:17 +02:00
János Benjamin Antal
13c9bf76af Add e2e tests for streams (#190)
* Add base of e2e tests

* Add python dependencies

* Explicitly close customer in destructor

* Parametrize tests and add test for CHECK STREAM

* Add tests for SHOW STREAMS

* Add test for concurrent start/stop during check

* Add test for calling check with an already started stream

* Run streams e2e tests on CI servers

Co-authored-by: antonio2368 <antonio2368@users.noreply.github.com>
Co-authored-by: Jure Bajic <jbajic@users.noreply.github.com>
2021-07-07 16:19:59 +02:00
János Benjamin Antal
ad32db5168 Use transformations in streams and CHECK STREAM (#185)
* Use the correct transformation result type

* Execute the result queries in streams

* Change the result type of parameters to nullable map

* Serialize transformation name

* Fix order of transformation parameters

* Use actual transformation in Streams

* Clear the Python transformations under GIL

* Add CHECK STREAM query

* Handle missing record fields properly
2021-07-07 16:19:59 +02:00
Kostas Kyrimis
a928c158da Add python API for messages transformations (#181)
* Add python messages/transformations implementation

* Added fixed result return type to transformations

* Added is_deprecated to mgp_trans
2021-07-07 16:08:23 +02:00
Kostas Kyrimis
d80ff745eb Introduce mgp_trans api (#175)
* Added public interface for registering mgp_trans and extended modules accordingly

* Added test for mgp_trans

* Added mg.transformations() to the module registry

Co-authored-by: János Benjamin Antal <antaljanosbenjamin@users.noreply.github.com>
2021-07-07 15:57:36 +02:00
Kostas Kyrimis
4004e94ca1 Introduce messages C-API (#168) 2021-07-07 15:38:51 +02:00
Marko Budiselić
542a324c96
Fix typing to cypher type impl inside mgp.py (#159) 2021-06-09 19:09:43 +02:00
Kostas Kyrimis
524acb17a1
Add global version allocators for C in query modules (#162) 2021-06-07 14:45:05 +02:00
antonio2368
ccdd58b336
Fix parsing nested complex types (#142)
* Fix parsing of types for mgp.List
2021-04-27 08:31:18 +02:00
llugovicmg
9d6b578237
Add the NetworkX query module (#5)
* Add __deepcopy__ for Properties
* Fix Vertices __contains__
* Check the incoming type in Vertex and Edge __eq__
* Add NetworkX support code
* Add NetworkX algorithms
* PageRank is now included in the nxalg module
* Rewrite graph analyzer to use NetworkX support code
* Don't make the error case be the "default" case
2020-10-01 20:51:55 +02:00
Lovro Lugovic
8fb3a53b78 Expose query timeout checking to modules
Summary:
- Add the `mgp_must_abort(const mgp_graph *graph)` C API.
- Add the `ProcCtx.must_abort()` Python API.

The usage is very simple -- the function returns a boolean indicating whether
the procedure should abort.

Reviewers: mferencevic, dsantl

Reviewed By: mferencevic

Subscribers: pullbot

Differential Revision: https://phabricator.memgraph.io/D2742
2020-04-01 13:30:03 +02:00
Lovro Lugovic
e5b3414335 Implement the PageRank module
Reviewers: teon.banek

Reviewed By: teon.banek

Subscribers: pullbot

Differential Revision: https://phabricator.memgraph.io/D2730
2020-03-25 13:58:50 +01:00
Ivan Paljak
44917fdfa6 Use storage::EdgeAccessor::Gid() as __hash__ for mgp.Edge
Reviewers: teon.banek, mferencevic

Reviewed By: teon.banek, mferencevic

Subscribers: pullbot

Differential Revision: https://phabricator.memgraph.io/D2729
2020-03-18 15:13:13 +01:00
Ivan Paljak
7b824ed622 Add __hash__ to mgp.Vertex and mgp.Edge
Reviewers: teon.banek

Reviewed By: teon.banek

Subscribers: pullbot

Differential Revision: https://phabricator.memgraph.io/D2725
2020-03-17 13:46:09 +01:00
Teon Banek
eaabcd8d0d Use fully_qualified_name for typing resolution
Reviewers: ipaljak, buda

Reviewed By: buda

Differential Revision: https://phabricator.memgraph.io/D2720
2020-03-12 14:04:44 +01:00
Ivan Paljak
181f937c15 Add Python class for mgp_properties_iterator
Reviewers: teon.banek

Reviewed By: teon.banek

Subscribers: pullbot

Differential Revision: https://phabricator.memgraph.io/D2712
2020-03-10 14:34:32 +01:00
Teon Banek
fbdcad1106 Implement calling Python procedures
Summary:
You should now be able to invoke query procedures written in Python. To
test the example you can run memgraph with PYTHONPATH set to `include`.
For example, assuming you are in the root of the repo, run this command.

    PYTHONPATH=$PWD/include ./build/memgraph --query-modules-directory=./query_modules/

Alternatively, you can set a symlink inside the ./query_modules to point
to `include/mgp.py`, so there's no need to set PYTHONPATH. For example,
assuming you are in the root of the repo, run the following.

    cd ./query_modules
    ln -s ../include/mgp.py
    cd ..
    ./build/memgraph --query-modules-directory=./query_modules/

Depends on D207

Reviewers: mferencevic, ipaljak, dsantl

Reviewed By: ipaljak

Subscribers: buda, tlastre, pullbot

Differential Revision: https://phabricator.memgraph.io/D2708
2020-03-06 16:25:51 +01:00
Teon Banek
d531e44bef Merge Invalid.*Error into InvalidContextError
Summary:
There's no need for so many Exception subclasses, because the root cause
is always the same.

Depends on D2700

Reviewers: mferencevic, ipaljak

Reviewed By: mferencevic, ipaljak

Subscribers: pullbot

Differential Revision: https://phabricator.memgraph.io/D2701
2020-03-04 12:52:05 +01:00
Teon Banek
74d9dd0b0a Implement mgp.Path
Reviewers: ipaljak, mferencevic

Reviewed By: ipaljak, mferencevic

Subscribers: pullbot

Differential Revision: https://phabricator.memgraph.io/D2700
2020-03-04 12:51:06 +01:00