The current datastore/store implementation is quite complex with some 'loops' and database specific elements in generic classes.
Here is the current schema of interfaces/packages:
Other packages work with instances of the only type in the schema.
I propose change it it like this:
- The common store.Store takes care of initialization in a generic way, without knowing about specific databases.
- No intermediate stores in specific packages.
- Specific database implementations moved to dedicated structs (with explicit naming), including initialization, and are embedded as needed in the package's repository implementations. Common struct used for function needed during initialization by store.Store.
- Should a new type of storage be used, only the implementation of the generic store + the implementation of the repository would be added + a way to initialize the correct "sub-store." This is shown with low opacity on the schema.
- Other packages still use the only type in the schema.
The current datastore/store implementation is quite complex with some 'loops' and database specific elements in generic classes.
Here is the current schema of interfaces/packages:
Other packages work with instances of the only type in the schema.
I propose change it it like this: