Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multi-Module Database #904

Open
vanitasvitae opened this issue Nov 22, 2019 · 1 comment
Open

Multi-Module Database #904

vanitasvitae opened this issue Nov 22, 2019 · 1 comment

Comments

@vanitasvitae
Copy link

Hi everyone!

I was wondering, if it is possible to use requery in a multi module architecture where different modules may have their own tables.

The problem I'm facing is that I'm working on a modular Android application, where different features are horizontally separated into different modules. Now, all this modularization makes no sense if in the end the database module depends on all of these feature modules, so I'm wondering if it is possible to have a "main" database module where other modules can be dynamically plugged into. I don't want to have a "god database module", but I don't want to have one database per feature either.
The problem I'm facing is being described pretty well in this IO/19 talk.

I did some digging and found that it may be possible to solve the issue by using the EntityModelBuilder to collect all entities of all active modules and use the resulting Model instead of Models.DEFAULT when creating a DataSource?

Does anyone have experience in this and/or tell me if I'm on the right track?

PS: Great work! I really like requery :)

@npurushe
Copy link
Contributor

Currently this isn't possible as the processor can only work on one module at a time, but there maybe some way to make this work by generating the model in a different module. However there does have to be at least one module that references all the other modules where the model links get generated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants