androidx.room
Classes
CoroutinesRoom |
A helper class for supporting Kotlin Coroutines in Room. |
DatabaseConfiguration |
Configuration class for a |
FtsOptions | |
InvalidationTracker |
InvalidationTracker keeps a list of tables modified by queries and notifies its callbacks about these tables. |
Room |
Utility class for Room. |
RoomDatabase |
Base class for all Room databases. |
RoomWarnings |
The list of warnings that are produced by Room. |
RxRoom |
Helper class to add RxJava2 support to Room. |
Exceptions
EmptyResultSetException |
Thrown by Room when the query in a Single<T> DAO method needs to return a result but the returned result from the database is empty. |
Annotations
ColumnInfo |
Allows specific customization about the column associated with this field. |
Dao |
Marks the class as a Data Access Object. |
Database |
Marks a class as a RoomDatabase. |
DatabaseView |
Marks a class as an SQLite view. |
Delete |
Marks a method in a |
Embedded |
Marks a field of an |
Entity |
Marks a class as an entity. |
ForeignKey |
Declares a foreign key on another |
Fts3 |
Marks an |
Fts4 |
Marks an |
Ignore |
Ignores the marked element from Room's processing logic. |
Index |
Declares an index on an Entity. |
Insert |
Marks a method in a |
Junction |
Declares a junction to be used for joining a relationship. |
OnConflictStrategy |
Set of conflict handling strategies for various |
PrimaryKey |
Marks a field in an |
Query |
Marks a method in a |
RawQuery |
Marks a method in a |
Relation |
A convenience annotation which can be used in a POJO to automatically fetch relation entities. |
SkipQueryVerification |
Skips database verification for the annotated element. |
Transaction |
Marks a method in a |
TypeConverter |
Marks a method as a type converter. |
TypeConverters |
Specifies additional type converters that Room can use. |
Update |
Marks a method in a |
Extension functions summary
For RoomDatabase | |
suspend R |
RoomDatabase.withTransaction(block: suspend () -> R) Calls the specified suspending block in a database transaction. |
Extension functions
withTransaction
suspend fun <R> RoomDatabase.withTransaction(block: suspend () -> R): R
Calls the specified suspending block in a database transaction. The transaction will be marked as successful unless an exception is thrown in the suspending block or the coroutine is cancelled.
Room will only perform at most one transaction at a time, additional transactions are queued and executed on a first come, first serve order.
Performing blocking database operations is not permitted in a coroutine scope other than the one received by the suspending block. It is recommended that all Dao function invoked within the block be suspending functions.
The dispatcher used to execute the given block will utilize threads from Room's query executor.