-
-
Notifications
You must be signed in to change notification settings - Fork 440
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
CoverageSqliteData._file_id: use "insert or replace" #723
Conversation
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.
LGTM although I would favor a SQL-only simpler approach, as described.
Codecov Report
@@ Coverage Diff @@
## master #723 +/- ##
=======================================
Coverage 90.24% 90.24%
=======================================
Files 78 78
Lines 10884 10884
Branches 1127 1127
=======================================
Hits 9822 9822
Misses 939 939
Partials 123 123
Continue to review full report at Codecov.
|
If `add` is not True, return None. | ||
""" | ||
if filename not in self._file_map: | ||
if add: | ||
with self._connect() as con: | ||
cur = con.execute("insert into file (path) values (?)", (filename,)) | ||
cur = con.execute("insert or replace into file (path) values (?)", (filename,)) |
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.
How does this fix relate to #760?
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.
You've made the link.. I guess it can help, but can only say it for #702 (comment) really, although I've not tested the "insert or replace" attempt with that one.
Fixes #702