Disconnect SqliteStorage from ExtendedStorage API#31
Closed
dcaliste wants to merge 10 commits into
Closed
Conversation
Don't assume that incidences are shared pointer when it's not necessary, like in internal database reads.
Use direct reference to ExtendedStorage when there is no intent to keep a pointer on this objects. Use the notebook uid as argument instead of passing the calendar to get it.
Contributor
Author
|
This is now superceeded by #37. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
@pvuorela this is an example of PR that could be extracted from #28 without touching the public API.
The final goal is to make SqliteStorage API as simple (and disconnected from the one of ExtendedStorage) as possible. Ideally, it would one day inherit from a new StorageBackend interface with minimal functions, like some to load / save notebooks and some to load / save incidences. It should not be responsible of storing the incidences or monitoring the incidence storage. It should just be a incidences (+ notebooks) serialiser / deserialiser into / from an SQlite database.
It is based on the noptr branch that is targetted to be in soon. I'll rebase when it is the case.
The two commits are starting to separate the calendar handling (dedicated into ExtendedStorage) and the serialisation:
Notice : for the second commit, later on, I could create a dedicated SQlite statement to remove all components where notebook == nbuid instead of listing them and deleting them one by one as done now. But I was more concentrating on API revamp than code revamp.
The next step to the overall goal is to simplify the numerous load*() method from SqliteStorage and have a simple API here, leaving the numerous load methods to ExtendedStorage API only. I've done it (see my separate branch) and I'll see if it is othogonal to this PR and can be submitted alone, or if I need to wait for this one to go in first.