pardom-zz / ActiveAndroid

Active record style SQLite persistence for Android
http://www.activeandroid.com
4.7k stars 1.03k forks source link

Manage multiple databases #352

Open NorbertSzydlowski opened 9 years ago

NorbertSzydlowski commented 9 years ago

Is possible manage two or more databases using ActiveAndroid?

scinfu commented 9 years ago

+1

CeccoCQ commented 9 years ago

+1

todorus commented 9 years ago

Today I found myself having the same issue. I did find a way to have it backwards compatible with the api that is exposed to the end user of the library, so it can certainly be done. I started working on it on my fork and having hacked at it for a few hours, I don't think this is a good idea for a pull request.

ActiveAndroid assumes the Cache object to be a singleton. To change this, a lot of other internal methods need to be given a Cache as a parameter. This will change the internal api in so many places that all other pull requests will probably have merge conflicts.

be warned that this is very much a work in progress the fork also has other edits for issues I had with the library https://github.com/todorus/ActiveAndroid/tree/feature/multiple_databases