Realm

interface Realm : TypedRealm

A Realm instance is the main entry point for interacting with a persisted Realm.

See also

Types

Companion
Link copied to clipboard
common
object Companion

Functions

close
Link copied to clipboard
common
abstract fun close()
Close this Realm and all underlying resources.
getNumberOfActiveVersions
Link copied to clipboard
common
abstract fun getNumberOfActiveVersions(): Long
Returns the current number of active versions in the Realm file.
isClosed
Link copied to clipboard
common
abstract fun isClosed(): Boolean
Check if this Realm has been closed or not.
objects
Link copied to clipboard
common
abstract override fun <T : RealmObject> objects(clazz: KClass<T>): RealmResults<T>
Returns the results of querying for all objects of a specific type.
observe
Link copied to clipboard
common
abstract fun observe(): Flow<Realm>
Observe changes to the Realm.
version
Link copied to clipboard
common
abstract fun version(): VersionId
Returns the Realm version of this object.
write
Link copied to clipboard
common
abstract suspend fun <R> write(block: MutableRealm.() -> R): R
Modify the underlying Realm file in a suspendable transaction on the default Realm Write Dispatcher.
writeBlocking
Link copied to clipboard
common
abstract fun <R> writeBlocking(block: MutableRealm.() -> R): R
Modify the underlying Realm file while blocking the calling thread until the transaction is done.

Properties

configuration
Link copied to clipboard
common
abstract val configuration: RealmConfiguration
Configuration used to configure this Realm instance.