-
Notifications
You must be signed in to change notification settings - Fork 197
Bookmarking #104
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
Bookmarking #104
Conversation
93ae985
to
10ac871
Compare
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.
@nigelsmall review completed, couple small comments.
@@ -336,6 +338,8 @@ def run(self, statement, parameters=None, **kwparameters): | |||
:return: Cypher result | |||
:rtype: :class:`.StatementResult` | |||
""" | |||
self.last_bookmark = None |
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.
Do we need to do this initialization together with initialization in line 314?
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.
Ah, yes we do. This clears the bookmark before a run, it's not initialisation.
self.transaction = Transaction(self, on_close=clear_transaction) | ||
return self.transaction | ||
|
||
def commit_transaction(self): | ||
self.run("COMMIT") | ||
result = self.run("COMMIT") | ||
self.connection.sync() |
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.
Is there a way to test that we send commit and rollback messages eagerly?
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.
Tests added for that.
@@ -238,19 +243,21 @@ def __init__(self, sock, **config): | |||
# Pick up the server certificate, if any | |||
self.der_encoded_server_certificate = config.get("der_encoded_server_certificate") | |||
|
|||
def on_success(metadata): | |||
self.server_version = metadata.get("server") |
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.
server_version
field is initialized here but where is it read?
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.
Just used in a test right now. It will conflict with #108 so I'll adjust it properly for that.
self.connection.in_use = False | ||
self.connection = None | ||
|
||
def begin_transaction(self): | ||
def begin_transaction(self, bookmark=None): | ||
""" Create a new :class:`.Transaction` within this session. |
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.
Should docstring also say something about the bookmark parameter?
10ac871
to
aeeff47
Compare
90050c5
to
f705004
Compare
No description provided.