-
Notifications
You must be signed in to change notification settings - Fork 2
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
Use contextmanager for SQLite communication #91
Conversation
I was wondering if you could simply call (you probably know more about this than me) Also, thoughts on using |
CodSpeed Performance ReportMerging #91 will not alter performanceComparing Summary
|
Nothing is set in stone, haven't really tested it yet. Having to open a connection for each of the commit could be slow, but I don't know. #8 had |
No I don't think it's opening a new connection each time; it's reusing the same connection with transactional things: |
There is a difference between the example in https://blog.rtwilson.com/a-python-sqlite3-context-manager-gotcha/ and https://docs.python.org/3/library/sqlite3.html#how-to-use-the-connection-context-manager. The first creates a new connection in the context manager, and the latter uses an existing connection in the context manager, which can be used again. I suspect the latter does something similar to what I have done; it could be something only newer versions of Python support. I will check this tomorrow. |
There is no significant difference between using holonote/holonote/annotate/connector.py Line 505 in 6257dd7
|
Fixes #8
Also adds a
close
method to close the database connection.