Add support for `Realm.copyFromRealm()`

This issue belongs to an archived project. You can view it, but you can't modify it. Learn more

XMLWordPrintableJSON

    • Type: Improvement
    • Resolution: Fixed
    • Priority: Minor - P4
    • None
    • Affects Version/s: None
    • Component/s: Local
    • None

      In Realm Java, there are use cases where you want to store objects in-memory, detached from Realm.

      • Avoid version pinning
      • Allow other reflection libraries
      • Enable "caching" for fast lookup of the same properties

      We could expose a similar API in Kotlin. 

      <T: RealmObject> Realm.copyFromRealm(obj: T, maxLimit: Int = Int.MAX_VALUE): T
       <T: RealmObject> Realm.copyFromRealm(objects: Iterable<T>, maxLimit: Int = Int.MAX_VALUE): List<T>

      Note, Projections as a feature might solve most of the same use cases, so we should consider if this is a better way of doing it. See https://github.com/realm/realm-java/issues/5426

       

       

              Assignee:
              Christian Melchior (Inactive)
              Reporter:
              Christian Melchior (Inactive)
              Archiver:
              Marc Greenfield

                Created:
                Updated:
                Resolved:
                Archived: