spine-tools / Spine-Database-API

Database interface to Spine generic data model
https://www.tools-for-energy-system-modelling.org/
GNU Lesser General Public License v3.0
6 stars 5 forks source link

Fix editing a locked db #258

Closed PiispaH closed 11 months ago

PiispaH commented 11 months ago

In a locked db if existing values are updated, the changes are stored in the cache and can be committed when the db is no longer locked. Removing items also works the same way. Adding items to a locked db is denied and will result in an error. If trying to commit changes in the db while it is locked an error telling the commit failed pops up. When the lock is resolved the changes can again be committed.

Re spine-tools/Spine-Toolbox#2201

Checklist before merging

codecov-commenter commented 11 months ago

Codecov Report

Patch coverage: 44.82% and project coverage change: -0.09% :warning:

Comparison is base (bd337e8) 75.43% compared to head (189eac0) 75.34%.

:exclamation: Your organization is not using the GitHub App Integration. As a result you may experience degraded service beginning May 15th. Please install the Github App Integration for your organization. Read more.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #258 +/- ## ========================================== - Coverage 75.43% 75.34% -0.09% ========================================== Files 76 76 Lines 10921 10941 +20 Branches 2378 2378 ========================================== + Hits 8238 8244 +6 - Misses 2243 2257 +14 Partials 440 440 ``` | [Files Changed](https://app.codecov.io/gh/spine-tools/Spine-Database-API/pull/258?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=spine-tools) | Coverage Δ | | |---|---|---| | [spinedb\_api/db\_mapping\_add\_mixin.py](https://app.codecov.io/gh/spine-tools/Spine-Database-API/pull/258?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=spine-tools#diff-c3BpbmVkYl9hcGkvZGJfbWFwcGluZ19hZGRfbWl4aW4ucHk=) | `77.35% <27.27%> (-1.58%)` | :arrow_down: | | [spinedb\_api/db\_mapping\_remove\_mixin.py](https://app.codecov.io/gh/spine-tools/Spine-Database-API/pull/258?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=spine-tools#diff-c3BpbmVkYl9hcGkvZGJfbWFwcGluZ19yZW1vdmVfbWl4aW4ucHk=) | `95.53% <50.00%> (-1.07%)` | :arrow_down: | | [spinedb\_api/db\_mapping\_commit\_mixin.py](https://app.codecov.io/gh/spine-tools/Spine-Database-API/pull/258?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=spine-tools#diff-c3BpbmVkYl9hcGkvZGJfbWFwcGluZ19jb21taXRfbWl4aW4ucHk=) | `69.23% <55.55%> (-4.11%)` | :arrow_down: | | [spinedb\_api/db\_mapping\_update\_mixin.py](https://app.codecov.io/gh/spine-tools/Spine-Database-API/pull/258?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=spine-tools#diff-c3BpbmVkYl9hcGkvZGJfbWFwcGluZ191cGRhdGVfbWl4aW4ucHk=) | `78.60% <60.00%> (-0.61%)` | :arrow_down: |

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.