You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I was thinking of passing 1 object box instance down as dependency to methods. But i soon reliased that you need to create 1 objectbox per model. e.g. the following will not work:
builder.Error=model.validate()
ifbuilder.Error!=nil {
builder.model=nil
} else {
builder.model=model// this line
}
So as i understand, i need to create 1 objectbox + 1 BxoForMODEL with one ObjectBox per model. Whith this being said, what is the recomanded way to deal with mutliple models? Instead of passing down from top of the stack just create these 2 instances every single time i need it ? I rather have 1 thing to pass down that has everything e.g. the sql driver (objecbox) which you create repositories (BoxForMODEL) with. 🤔
Also is it an idea to return an error when you try to regiester more then 1 model? Causes less confusion later when you get errors like
Could not create query - please check your query conditions: unordered_map::at: key not found
The text was updated successfully, but these errors were encountered:
I was thinking of passing 1 object box instance down as dependency to methods. But i soon reliased that you need to create 1 objectbox per model. e.g. the following will not work:
And this is because of
So as i understand, i need to create 1 objectbox + 1 BxoForMODEL with one ObjectBox per model. Whith this being said, what is the recomanded way to deal with mutliple models? Instead of passing down from top of the stack just create these 2 instances every single time i need it ? I rather have 1 thing to pass down that has everything e.g. the sql driver (objecbox) which you create repositories (BoxForMODEL) with. 🤔
Also is it an idea to return an error when you try to regiester more then 1 model? Causes less confusion later when you get errors like
The text was updated successfully, but these errors were encountered: