-
Notifications
You must be signed in to change notification settings - Fork 38
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
How to implement storageDatabaseForClass. #135
Comments
That was the intention, although I'm not sure if it asks for that information once, and not again. Therefore making it dynamic might not have the effect you were after. I will have to create a sample app and see what actions are being taken. Thanks for raising this. |
Wow! |
Hi. Thanks in advance. |
@ddferrando, yeah that is what I've found too. So, there is the rather clunky method of close/re-open database, although i've often had weird issues with live objects from previous connections messing things up. I've not made changes to shark in a while now, but I feel like the best possible implementation may be permanent filters. So if you were to add a userId column to the objects. Then we could maybe modify the query constructor to always include the filter. So something like: SharkORM.setFilter(Person.self, .query("userId", .equals, 1234)) This, would be one of the easiest adaptations. I'm not sure if it feels "right", or if actually creating materialised views would be better, and then query the views instead of the tables if set. How would you feel about those kinds of adaptations? |
Hi @editfmah The problem I am facing is than I am not able to create new tables on the new Database with same SharkObjects as used in other database. The steps I am doing are the following: Any suggestions to solve this issue? |
I am trying to save a entity models in different databases depending on a user.
As per requirements in our app we need to maintain separate databases for each user with same entity models.
On user change I need to point to its user database.
I was making some tests with storageDatabaseForClass but I am not able to make it work.
In my SRKObject we implemented
+(NSString*)storageDatabaseForClass
{
return @"dataBase1"
}
I thought that system will create automatically a new dataBase, but I see it's not working properly.
Any suggestion?
The text was updated successfully, but these errors were encountered: