-
Type: Improvement
-
Resolution: Fixed
-
Priority: Minor - P4
-
None
-
Affects Version/s: None
-
Component/s: None
-
None
-
?
-
1
-
181
-
Kotlin Beta sprint 8, Kotlin Beta sprint 9, Kotlin Beta sprint 10, Kotlin Beta sprint 18, Kotlin Beta sprint 19
Currently we have RealmObject.delete() as an extension method. This allows for a nice shorthand when writing
realm.writeBlocking { val john = copyToRealm(Person()) john.delete() }
Unfortunately, this is also possible outside the write transaction
val john = Person()
john.delete() // Will throw an exception
We should evaluate if the fluency of the API trumps making it slightly less safe or if we can find a better way to control the scope of the delete method.
We already expose a delete method on the MutableRealm, so you can do something like this:
realm.writeBlocking { val john = copyToRealm(Person()) delete(john) }
- is depended on by
-
RKOTLIN-149 Story: RealmObject interface API
- Closed