realm / realm-dart

Realm is a mobile database: a replacement for SQLite & ORMs.
Apache License 2.0
763 stars 87 forks source link

No need to place 'Embedded Objects' within Configuration <SchemaObject>[ #1001

Open dotjon0 opened 1 year ago

dotjon0 commented 1 year ago

Description

'embedded objects' currently have to be included within the Configuration <SchemaObject>[. This feature request is to support not having to place 'embedded objects' within the Configuration <SchemaObject>[. This will increase maintainability and readability - a database with 70 models could easily have a few hundred 'embedded objects'...

Here is a related thread which provides an example #662 for context:

@RealmModel() @MapTo('person') class _Person { late String name;

@MapTo('address') _Address? personAddress; }

// The generated Address class will be an embedded object. @RealmModel(ObjectType.embeddedObject) class _Address { late String street; late String city; }



### How important is this improvement for you?
Would be a major improvement
nielsenko commented 1 year ago

Actually, any dependency (embedded or not) could be automatically included, when adding a schema to a configuration, if we calculated the transitive dependencies in the generator.

dotjon0 commented 1 year ago

that would be amazing @nielsenko, sounds perfect!

dotjon0 commented 11 months ago

any updates on this?

nirinchev commented 11 months ago

No, this is not on our immediate Todo list as it's a nice to have feature, but doesn't unlock any new use cases.

dotjon0 commented 11 months ago

Hi @nielsenko thanks for the update. For us, we have around 100 models, and around 300 embedded models.... So for us this is not a nice to have feature, its an essential to make this manageable...

nielsenko commented 11 months ago

Hi @dotjon0. Credit for update goes to @nirinchev .. I guess over github usernames are a bit too similar 😄

nirinchev commented 11 months ago

@dotjon0 fair enough - as is the case with most of these features - if it's something you deem critical for your project, definitely bring it up with your AE. They have mechanisms to influence the product roadmap and would be in best position to advise engineering on what features would have the broadest impact across our customers.