objectbox-dart icon indicating copy to clipboard operation
objectbox-dart copied to clipboard

Multiple Store, generates all tables for each Store

Open lolohouse opened this issue 4 months ago • 1 comments

In my application, I want to have multiple Stores (separated by features) and each one with its own objects (they don't share objects). I've already created several Stores... everything's fine, but when viewing the MDBs through the desktop viewer (via Docker), I've seen that each MDB generates all the tables for all the objects (even though I only use some objects in some Stores and others in others). Can I specify which Store classes belong to the Store so that it only generates the specific tables?

Sorry for my English.

lolohouse avatar Sep 17 '25 09:09 lolohouse

Currently, there can only be one data model per Dart package. I guess to achieve what you want, you could create a separate package for each data model.

Maybe helpful in understanding this: the model is passed to the Store constructor. If you use the generated openStore method, look at its implementation. The method that creates the model is created by the generator.

Note: I labeled this issue with "more info required" so it will auto-close in a few days if there are no follow-up comments.

greenrobot-team avatar Sep 22 '25 06:09 greenrobot-team