Skip to content

[Repositories] Explicitly pass database pointers to repository methods#1225

Merged
Akkadius merged 1 commit intomasterfrom
akkadius/repository-improvements
Feb 6, 2021
Merged

[Repositories] Explicitly pass database pointers to repository methods#1225
Akkadius merged 1 commit intomasterfrom
akkadius/repository-improvements

Conversation

@Akkadius
Copy link
Copy Markdown
Contributor

@Akkadius Akkadius commented Feb 6, 2021

This change comes as a result of some user feedback and some of my own experience as I've been using repositories in code

The original intent of a repository method was to make it as intuitive and simple to use as possible so the generation made assumptions about what database pointer it should use under the hood database or content_db.

This all works fine and dandy, however this pattern breaks down as soon as we want to use a repository in any shared ./common logic. The reason for this is our poorly distributed Database logic. For world and zone we have separate classes tied to pointers database and content_db so we cannot use shared type signatures and make assumptions within the repository methods

For this reason, these assumptions and attempts to simplify usage of repositories are outweighed by the annoyances of not being able to use them in any ./common shared logic which is a very common use case

This PR implements explicitly passing in database pointers into repository methods and updates all of the referenced places in the code where its used

@Akkadius Akkadius requested a review from hgtw February 6, 2021 05:12
@Akkadius Akkadius merged commit 18e9c4d into master Feb 6, 2021
@Akkadius Akkadius deleted the akkadius/repository-improvements branch February 8, 2021 00:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants