The result I'm trying to achieve involves having an application with a database with minimal tables that store data regarding users on the system, this database would be used to verify user's login details when they login to the application. What I want to be able to do is to dynamically connect to another database once the user has logged in, based on details stored about that user in the main database.
Basically I want each user on the system to have their own database, connect to that database once they login, and be able to use common db model classes (since each user's db will have the same tables as every other user's db).
Is this possible? And if so, how would I implement the dynamic db connection (let's say in the action that validates their login details).
Any help would be greatly appreciated.