Closed aogier closed 5 years ago
Ok I think I'm ready for a code review. Tests are passing and all seems promising but I'd definitely like another couple of eyes :)
meh, I forgot setdefault
...
added setdefault
I've reintroduced _doc_id logic on some dict methods I'll fix it asap
_document_id logic re-removed from code
Thanks for all your recent work. It is really appreciated. We’ve discussed this change as a team and feel it’s adding too much complexity to the Document
class. I’ve tried a different implementation; instead I compute/compare a hash of the document on each save (here). This change is less invasive but likely a more expensive solution.
We’ve decided the library shouldn't offer this feature. If a user is calling .save()
multiple times without updating the document then that’s their decision.
Thanks again and have a good weekend.
Hi, it seems a good conclusion to me and as a couchdb noob I'll take this design choice as an implementation hint especially on where to put my ctx manager. Thank you for your time and keep up the good work :)
ciao
Checklist
CHANGES.md
|CHANGELOG.md
) or test/build only changesDescription
Trivial change that commit to remote db only when creating or actually changing local data.
Current behaviour:
New behaviour:
Approach
Implemented a simple boolean check that flip upon Document's dict update methods calls. Document will still be created even if empty, but save will only happen when an actual change is made, minimizing data transfers.
Schema & API Changes
Document.save
only when creating or local copy changed.Security and Privacy
Testing
Monitoring and Logging