-
Notifications
You must be signed in to change notification settings - Fork 13
Introduce Driver.execute_query
#531
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
32 commits
Select commit
Hold shift + click to select a range
b271a28
Introduce `Driver.execute_query`
bigmontz a932e10
add test_execute_query_without_config
bigmontz 1985a82
Add tests for test_configure_routing_to_readers and test_configure_ro…
bigmontz c6c4b16
Add tests to test_configure_database
bigmontz 6ad790f
Add test_configure_impersonated_user
bigmontz 02d8b64
Address comments in the PR
bigmontz ea76103
Apply suggestions from code review
bigmontz bb986e0
Add Feature flag
bigmontz 6abe39d
Add test_causal_consistency_between_query_executions
bigmontz c6ef97a
Add test_disable_bookmark_manager
bigmontz b658d19
Rename property to bookmarkManagerId
bigmontz db4f804
Add test_configure_custom_bookmark_manager
bigmontz 4a682e3
Enumerate new tests
bigmontz 02ee8ed
add test_retry_on_retriable_error
bigmontz fa614c5
Add scripts
bigmontz 7eaba13
Add test for test_thrown_non_retriable_error
bigmontz e61527e
Address comment in the PR
bigmontz f7bd0bb
Extracting config params and define bookmarkManagerId=-1 as the disab…
bigmontz 7ab4027
Make query concistent
bigmontz e7fcdb9
Docs and summary assertion
bigmontz 5f69bb1
Adjust expected and actual value order in assertions
bigmontz 0267330
Stub script formatting
robsdedude d1a5e61
Some Python formatting
robsdedude 3fcfc89
Apply suggestions from code review
bigmontz c5ca626
Address comments in the PR
bigmontz 4740571
Improve `transaction_chaining.script`
bigmontz 23d4279
Update tests/stub/driver_execute_query/scripts/transaction_chaining_c…
bigmontz 16e2d99
Grammar
robsdedude e031aeb
Refactoring
robsdedude c9505ce
Fix messed up merge
robsdedude 66771bc
Not filtering params from the ExecuteQuery
bigmontz 5d9e945
Add missing optional RESET to script
robsdedude File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
!: BOLT 5.0 | ||
!: ALLOW RESTART | ||
|
||
A: HELLO {"{}": "*"} | ||
{+ | ||
C: ROUTE "*" "*" "*" | ||
S: SUCCESS {"rt": {"ttl": 1000, "db": "adb", "servers": [{"addresses": ["#HOST#:9000"], "role":"ROUTE"}, {"addresses": ["#HOST#:9010"], "role":"READ"}, {"addresses": ["#HOST#:9020"], "role":"WRITE"}]}} | ||
?: RESET | ||
+} | ||
?: GOODBYE |
12 changes: 12 additions & 0 deletions
12
tests/stub/driver_execute_query/scripts/router_invert_reader_and_writer_second_call.script
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
!: BOLT 5.0 | ||
!: ALLOW RESTART | ||
|
||
A: HELLO {"{}": "*"} | ||
C: ROUTE "*" "*" "*" | ||
S: SUCCESS {"rt": {"ttl": 1000, "db": "adb", "servers": [{"addresses": ["#HOST#:9000"], "role":"ROUTE"}, {"addresses": ["#HOST#:9010"], "role":"READ"}, {"addresses": ["#HOST#:9020"], "role":"WRITE"}]}} | ||
?: RESET | ||
C: ROUTE "*" "*" "*" | ||
S: SUCCESS {"rt": {"ttl": 1000, "db": "adb", "servers": [{"addresses": ["#HOST#:9000"], "role":"ROUTE"}, {"addresses": ["#HOST#:9020"], "role":"READ"}, {"addresses": ["#HOST#:9010"], "role":"WRITE"}]}} | ||
?: RESET | ||
|
||
?: GOODBYE |
8 changes: 8 additions & 0 deletions
8
tests/stub/driver_execute_query/scripts/router_with_db_name.script
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
!: BOLT 5.0 | ||
!: ALLOW RESTART | ||
|
||
A: HELLO {"{}": "*"} | ||
C: ROUTE "*" "*" {"db":"neo4j"} | ||
S: SUCCESS {"rt": {"ttl": 1000, "db": "neo4j", "servers": [{"addresses": ["#HOST#:9000"], "role":"ROUTE"}, {"addresses": ["#HOST#:9010"], "role":"READ"}, {"addresses": ["#HOST#:9020"], "role":"WRITE"}]}} | ||
*: RESET | ||
?: GOODBYE |
8 changes: 8 additions & 0 deletions
8
tests/stub/driver_execute_query/scripts/router_with_impersonation.script
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
!: BOLT 5.0 | ||
!: ALLOW RESTART | ||
|
||
A: HELLO {"{}": "*"} | ||
C: ROUTE "*" "*" {"imp_user": "that-other-dude"} | ||
S: SUCCESS {"rt": {"ttl": 1000, "db": "adb", "servers": [{"addresses": ["#HOST#:9000"], "role":"ROUTE"}, {"addresses": ["#HOST#:9010"], "role":"READ"}, {"addresses": ["#HOST#:9020"], "role":"WRITE"}]}} | ||
*: RESET | ||
?: GOODBYE |
39 changes: 39 additions & 0 deletions
39
tests/stub/driver_execute_query/scripts/transaction_chaining.script
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
!: BOLT 5.0 | ||
|
||
A: HELLO {"{}": "*"} | ||
*: RESET | ||
|
||
C: BEGIN {"[db]": "*"} | ||
S: SUCCESS {} | ||
C: RUN "CREATE (p:Person {name:$name}) RETURN p.name AS name" {"name": "the person"} {} | ||
S: SUCCESS {"fields": ["name"]} | ||
C: PULL {"n": 1000} | ||
S: RECORD ["the person"] | ||
SUCCESS {"type": "w"} | ||
C: COMMIT | ||
S: SUCCESS {"bookmark": "bm1"} | ||
*: RESET | ||
|
||
{{ | ||
C: BEGIN {"[db]": "*"} | ||
S: SUCCESS {} | ||
C: RUN "MATCH (p:Person {name:$name}) RETURN p.name AS name" {"name": "the person"} {} | ||
S: SUCCESS {"fields": ["name"]} | ||
C: PULL {"n": 1000} | ||
S: SUCCESS {"type": "r"} | ||
C: COMMIT | ||
S: SUCCESS {"bookmark": "bm1"} | ||
---- | ||
C: BEGIN {"bookmarks": ["bm1"], "[db]": "*"} | ||
S: SUCCESS {} | ||
C: RUN "MATCH (p:Person {name:$name}) RETURN p.name AS name" {"name": "the person"} {} | ||
S: SUCCESS {"fields": ["name"]} | ||
C: PULL {"n": 1000} | ||
S: RECORD ["the person"] | ||
SUCCESS {"type": "r"} | ||
C: COMMIT | ||
S: SUCCESS {"bookmark": "bm2"} | ||
}} | ||
*: RESET | ||
|
||
?: GOODBYE |
39 changes: 39 additions & 0 deletions
39
tests/stub/driver_execute_query/scripts/transaction_chaining_custom_bmm.script
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
!: BOLT 5.0 | ||
|
||
A: HELLO {"{}": "*"} | ||
*: RESET | ||
|
||
C: BEGIN {"bookmarks": ["other_db:bm1"], "[db]": "*"} | ||
S: SUCCESS {} | ||
C: RUN "CREATE (p:Person {name:$name}) RETURN p.name AS name" {"name": "a person"} {} | ||
S: SUCCESS {"fields": ["name"]} | ||
C: PULL {"n": 1000} | ||
S: RECORD ["a person"] | ||
SUCCESS {"type": "w"} | ||
C: COMMIT | ||
S: SUCCESS {"bookmark": "bm1"} | ||
*: RESET | ||
|
||
robsdedude marked this conversation as resolved.
Show resolved
Hide resolved
|
||
{{ | ||
C: BEGIN {"bookmarks": ["other_db:bm1"], "[db]": "*"} | ||
S: SUCCESS {} | ||
C: RUN "MATCH (p:Person {name:$name}) RETURN p.name AS name" {"name": "a person"} {} | ||
S: SUCCESS {"fields": ["name"]} | ||
C: PULL {"n": 1000} | ||
S: SUCCESS {"type": "r"} | ||
C: COMMIT | ||
S: SUCCESS {"bookmark": "bm1"} | ||
---- | ||
C: BEGIN {"bookmarks{}": ["bm1", "other_db:bm1"], "[db]": "*"} | ||
S: SUCCESS {} | ||
C: RUN "MATCH (p:Person {name:$name}) RETURN p.name AS name" {"name": "a person"} {} | ||
S: SUCCESS {"fields": ["name"]} | ||
C: PULL {"n": 1000} | ||
S: RECORD ["a person"] | ||
SUCCESS {"type": "r"} | ||
C: COMMIT | ||
S: SUCCESS {"bookmark": "bm2"} | ||
}} | ||
*: RESET | ||
|
||
?: GOODBYE |
15 changes: 15 additions & 0 deletions
15
tests/stub/driver_execute_query/scripts/tx_return_1.script
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
!: BOLT 5.0 | ||
|
||
A: HELLO {"{}": "*"} | ||
*: RESET | ||
C: BEGIN {"{}": "*"} | ||
S: SUCCESS {} | ||
C: RUN "RETURN 1 AS n" {} {} | ||
S: SUCCESS {"fields": ["n"], "qid": 1} | ||
C: PULL {"n": 1000} | ||
S: RECORD [1] | ||
SUCCESS {"type": "r"} | ||
C: COMMIT | ||
S: SUCCESS {"bookmark": "neo4j:bookmark:v1:tx424242"} | ||
*: RESET | ||
?: GOODBYE |
10 changes: 10 additions & 0 deletions
10
tests/stub/driver_execute_query/scripts/tx_return_1_disconnect_on_pull.script
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
!: BOLT 5.0 | ||
|
||
A: HELLO {"{}": "*"} | ||
*: RESET | ||
C: BEGIN {"{}": "*"} | ||
S: SUCCESS {} | ||
C: RUN "RETURN 1 AS n" {} {} | ||
S: SUCCESS {"fields": ["n"], "qid": 1} | ||
C: PULL {"n": 1000} | ||
S: <EXIT> |
12 changes: 12 additions & 0 deletions
12
tests/stub/driver_execute_query/scripts/tx_return_1_transaction_terminated_on_pull.script
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
!: BOLT 5.0 | ||
|
||
A: HELLO {"{}": "*"} | ||
*: RESET | ||
C: BEGIN {"{}": "*"} | ||
S: SUCCESS {} | ||
C: RUN "RETURN 1 AS n" {} {} | ||
S: SUCCESS {"fields": ["n"], "qid": 1} | ||
C: PULL {"n": 1000} | ||
S: FAILURE {"code": "Neo.ClientError.Transaction.Terminated", "message": "message"} | ||
*: RESET | ||
?: GOODBYE |
15 changes: 15 additions & 0 deletions
15
tests/stub/driver_execute_query/scripts/tx_return_1_with_impersonation.script
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
!: BOLT 5.0 | ||
|
||
A: HELLO {"{}": "*"} | ||
*: RESET | ||
C: BEGIN {"imp_user": "that-other-dude", "db": "adb"} | ||
S: SUCCESS {} | ||
C: RUN "RETURN 1 AS n" {} {} | ||
S: SUCCESS {"fields": ["n"], "qid": 1} | ||
C: PULL {"n": 1000} | ||
S: RECORD [1] | ||
SUCCESS {"type": "r"} | ||
C: COMMIT | ||
S: SUCCESS {"bookmark": "neo4j:bookmark:v1:tx424242"} | ||
*: RESET | ||
?: GOODBYE |
15 changes: 15 additions & 0 deletions
15
tests/stub/driver_execute_query/scripts/tx_return_1_with_params.script
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
!: BOLT 5.0 | ||
|
||
A: HELLO {"{}": "*"} | ||
*: RESET | ||
C: BEGIN {"{}": "*"} | ||
S: SUCCESS {} | ||
C: RUN "RETURN $a AS n" { "a": 1 } {} | ||
S: SUCCESS {"fields": ["n"], "qid": 1} | ||
C: PULL {"n": 1000} | ||
S: RECORD [1] | ||
SUCCESS {"type": "r", "db": "#DB#"} | ||
C: COMMIT | ||
S: SUCCESS {"bookmark": "neo4j:bookmark:v1:tx424242"} | ||
*: RESET | ||
?: GOODBYE |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what's
Ellipsis
? 🤔There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the
...