Uploaded image for project: 'Realm Kotlin'
  1. Realm Kotlin
  2. RKOTLIN-226

Add support for RealmConfiguration.initialData()

    • Type: Icon: Improvement Improvement
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: Sync
    • None

      In Realm Java, we have a concept called RealmConfiguration.initialData() which is a way to populate a Realm file the first time it is opened. This is pretty helpful in a lot of scenarios and should be added to Kotlin as well.

      It isn't supported in ObjectStore however, so should be added there, and the current behavior of resetting the Realm file will also cause problems with such a block. See #301

      Proposed API
      ```
      val config = RealmConfiguration.Builder(schema = setOf(...))
      .initialData

      { realm: MutableRealm -> /* Write data */ }

      .build()

            Assignee:
            Unassigned Unassigned
            Reporter:
            unitosyncbot Unito Sync Bot
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: