What’s New

Room

Frameworks & LibrariesAI extracted

AndroidX's SQLite persistence library — compile-time-checked queries over a database.

Latest 2.8.4 · by GoogleWebsite

Changelog

2.8.4

Version 2.8.4

Added a prepared statement cache to Room's connection pool when using a SQLiteDriver that does not internally have a pool, such as the BundledSQLiteDriver. This improves performance on repeated execution of the same SQL statement. Fix an issue where the actual / expected error message on schema validation was missing information. Fix an issue with Room's Kotlin code generation missing @Transaction DAO functions with type variables. Improve Room's SupportSQLite Wrapper performance by avoiding thread hops maintaining the same blocking behaviour as the SupportSQLiteDatabase APIs.

2.8.3

Version 2.8.3

Fix a performance issue with the Room SQLite Wrapper that was causing excessive JNI calls and significant performance degradation when iterating over a Cursor.

2.8.2

Version 2.8.2

Fix a deadlock that could occur when re-opening an auto-closed database from a Flow emission.

2.8.1

Version 2.8.1

Fix a processor crash that would occur when processing a DAO function with a suspend lambda. Fix a race condition that would prevent Flows from receiving the latest updated.

2.8.0

Version 2.8.0

Added a new artifact androidx.room:room-sqlite-wrapper which contains APIs to get a SupportSQLiteDatabase wrapper from a RoomDatabase with a configured SQLiteDriver. To get the wrapper use the new extension function RoomDatabase.getSupportWrapper(). This is a compatibility artifact to maintain usages of SupportSQLiteDatabase, usually obtained from roomDatabase.openHelper.writableDatabase, even if the Room database is configured with a SQLiteDriver. This wrapper is useful for incremental migration of codebases who wish to adopt SQLiteDriver APIs but have extensive usages of the SupportSQLite APIs yet they want to take advantage of the BundledSQLiteDriver. Checkout the migration guide for more information. Added support for KMP targets Watch OS and Tv OS. Updated the library's Android minSDK from API 21 to API 23

2.8.0-rc02

Version 2.8.0-rc02

Update the minSDK from API 21 to API 23 Update the minimum Android Gradle Plugin (AGP) version compatible with the Room Gradle Plugin from 8.1 to 8.4. Fix an issue where a destructive migration was being performed even if a migration path was available for a pre-packaged database.

2.8.0-rc01

Version 2.8.0-rc01

Removing obsolete @RequiresApi(21) annotations Fix a race condition where Room Flows would not emit the latest query result in an asynchronous multi-query/write situation.

2.8.0-beta01

Version 2.8.0-beta01

Table and view names are now escaped properly during destructive migrations.

2.8.0-alpha01

Version 2.8.0-alpha01

Added a new artifact androidx.room:room-sqlite-wrapper which contains APIs to get a SupportSQLiteDatabase wrapper of RoomDatabase with a configured SQLiteDriver. To get the wrapper use the new extension function RoomDatabase.getSupportWrapper(). This is a compatibility artifact to maintain usages of SupportSQLiteDatabase, usually obtained from RoomDatabase.openHelper.writableDatabase, even if the Room database is configured with a SQLiteDriver. This wrapper is useful for incremental migration of codebases who wish to adopt SQLiteDriver but have extensive usages of the SupportSQLite APIs yet they want to take advantage of the BundledSQLiteDriver.

2.7.2

Version 2.7.2

Fix an issue where annotation values would be incorrectly read when processing native sources with KSP, sometimes missing schema exports. (b/416549580) Fix a bug where leading comments in a SQL would cause statements to be executed as if they were non-read queries. (b/413061402) Fix an issue with Room's Gradle Plugin failing to configure due to the schema directory being empty. (b/417823384) No longer throw a SQLiteException when obtaining a connection takes too long, instead a log message will be sent by the library. Logging instead of throwing works around iOS suspending loopers causing Room to misinterpret the timeout that occurs in the Kotlin Coroutine acquiring the connection and thus preventing the exception from being thrown when an iOS app is backgrounded and later resumed in the middle of a database operation. (b/422448815)

2.7.1

Version 2.7.1

Fix IndexOutOfBoundsException bug during provided type converter validation. (b/409804755). Support RoomDatabase.runInTransaction() when a SQLiteDriver is configured with Room. (b/408364828).

2.7.0

Version 2.7.0

Kotlin Multiplatform (KMP) Support: In this release, Room has been refactored to become a Kotlin Multiplatform (KMP) library. Current supported platforms are Android, iOS, JVM (Desktop), native Mac and native Linux. For more information on how to get started using Room KMP, please refer to the official Room KMP documentation. As part of the KMP support, Room can also be configured with an SQLiteDriver, for information on how to migrate an existing app to the driver APIs and to Room KMP, see the migration documentation. Kotlin Code Generation on KSP has been turned ON by default if processing is done via KSP. For KAPT or Java only projects, Room will still generate Java sources. Kotlin 2.0 and KSP2: Room now targets Kotlin language 2.0 and will require projects to also compile with Kotlin 2.0 and equivalent or higher language version. Support for KSP2 is also added and is recommended when using Room with Kotlin 2.0 or higher.

2.7.0-rc03

Version 2.7.0-rc03

No longer throw InterruptedExceptionwhen a thread is interrupted during the execution of Room blocking APIs, including blocking DAO functions (b/400584611). Re-implement Room's connection pool in an attempt to alleviate SQLException: Error code: 5, message: Timed out attempting to acquire a reader connection. and similar issues (b/380088809).

2.7.0-rc02

Version 2.7.0-rc02

Fix Auto Migrations incorrectly handling a new column on an FTS table. (b/348227770, Ic53f3) Fix a room-compiler crash due to a NullPointerException when processing non-JVM sources via KSP. (b/396607230, I693c9) Fix an issue where Room would not invalidate tables at the end of using the writer connection. (b/340606803, I73ef6)

2.7.0-rc01

Version 2.7.0-rc01

Fix an issue where Room would not be setting the busy_timeout in the initial database connection that would lead to SQLException: Error code: 5, message: database is locked issues (I93208, b/380088809). Fix an issue in Room's compiler that would cause the KSP processor to crash when processing native source sets (such as iOS) on Kotlin 2.1.x and KSP1 (I883b8, b/396607230).

2.7.0-beta01

Version 2.7.0-beta01

Fix an issue with RoomDatabase.inTransaction() opening a closed database when it shouldn't and should quickly return false if the database is closed (b/325432967). Fix a crash (IllegalArgumentException: not a valid name) in Room's compiler when processing DAO functions with Kotlin inline / value classes (b/388299754). Include Proguard rules in the JVM artifact of room-runtime so that the default constructor of the generated database implementation is not removed since it is used by Room's default initialization that uses reflection (b/392657750).

2.7.0-alpha13

Version 2.7.0-alpha13

Room now targets Kotlin language 2.0 and will require projects to also compile with Kotlin 2.0 and equivalent or high language version. (I8efb0, b/315461431, b/384600605) Fix an issue in Room KMP database builder when a simple name instead of a path was used in Android and the database file resolved path would not be located in the app's data directory. (I83315, b/377830104) Fix an issue with the Room Gradle Plugin where configuring the schema inputs and output was causing an issue on Android projects: property 'inputDirectory' is final and cannot be changed any further. (1dbb4c, b/376071291) Add support for KSP2 in Room Gradle Plugin fixing an issue where the schema directory was not being properly set up by the plugin. (Iec3c4, b/379159770) Fix an issue with Room paging integration causing UI jumps when the initial key to refresh is too close to the end of the list. Thanks to Eva! (I2abbe, b/389729367)

2.7.0-alpha12

Version 2.7.0-alpha12

Add the experimental API RoomDatabase.Builder.setInMemoryTrackingMode() to configure whether Room will use an in-memory table or not for invalidation tracking. (I2a9b2, b/185414040) Destructive migrations now drop views to ensure they are recreated, aligning behavior when allowDestructiveMigrationForAllTables is ON (KMP default) with the existing behavior when it's OFF. (0a3e83, b/381518941)

2.7.0-alpha11

Version 2.7.0-alpha11

Revisit the newly added convertRows() method signature to be a suspend function that receives a RawRoomQuery for room-paging. (Ie57b5, b/369136627) Fixed the issue in room-paging where invalid code was being generated when using @Relation in conjunction with PagingSource.

2.7.0-alpha10

Version 2.7.0-alpha10

Create internal ByteArrayWrapper class to support Relations with ByteBuffer in non-Android & non-JVM platforms. (I75543, b/367205685) Add SQLiteStatement.getColumnType() along with the various SQLITE_DATA_* result constants to enable retrieving the data type of a column. (I1985c, b/369636251)

2.7.0-alpha09

Version 2.7.0-alpha09

Fix an issue with the KMP implementation of room-paging that would cause an Error code: 8, message: attempt to write a readonly database due to starting a write transaction on a read connection. (b/368380988)

2.7.0-alpha08

Version 2.7.0-alpha08

The room-paging artifacts have been migrated to be KMP compatible. (Ib8756, b/339934824) The API invalidationTrackerFlow() has been commonized as a first-party API as InvalidationTracker.createFlow() and is now available for non-Android source sets in KMP projects. (I1fbfa, (I8fb29), b/329291639, b/329315924) All warnings and error messages in Room that use the word Cursor have been removed or replaced, as Cursor is no longer an accurate general term to use in the KMP version of Room. (Id8cd9, b/334087492) Fixed an issue where Room KMP would try to emit code using UUID for non-JVM platforms. (b/362994709) Fixed an issue with the Room Gradle Plugin that would cause an error such as 'Cannot change attributes of configuration … after it has been locked for mutation' when being used in a KMP project with Compose Multiplatform. (b/343408758)

2.7.0-alpha07

Version 2.7.0-alpha07

The Room Gradle Plugin will now automatically add the exported schemas into the Android Instrumentation Test resource sources so they can be used by the MigrationTestHelper. Fixed an issue with the generated 'actual' of the RoomDatabaseConstructor missing the 'actual' modifier in the initialize function if such function is also overridden in the 'expect' declaration. (359631627) Fixed an issue with the generated 'actual' of the RoomDatabaseConstructor not matching the visibility of the 'expect' declaration. (358138953)

2.7.0-alpha06

Version 2.7.0-alpha06

Change the instantiation setup for a RoomDatabase in a KMP project. Due to Kotlin 2.0 compilation model, the strategy of referencing a to-be-generated function, named instantiateImpl() is longer viable. Two new APIs, @ConstructedBy and RoomDatabaseConstructor are introduced that replace the instantiateImpl() strategy. The new strategy is as follow: Define an expect object that implements RoomDatabaseConstructor expect object MyDatabaseCtor : RoomDatabaseConstructor Link the object with the @Database declaration using @ConstructedBy @Database (...) @ConstructedBy (MyDatabaseCtor : : class) // NEW abstract class MyDatabase : RoomDatabase Create a new database instance but without passing a factory argument fun createNewDatabase(path: String) = Room.databaseBuilder(name = path) .setDriver(BundledSQLiteDriver()) .setQueryCoroutineContext(Dispatchers.IO) .build() Fixes b/316978491, b/338446862, and b/342905180

2.7.0-alpha05

Version 2.7.0-alpha05

Renamed SQLiteKt to SQLite and BundledSQLiteKt to BundledSQLite. ( I8b501) Fixed a bug where a RoomDatabase would deadlock or error out with a connection timeout when using the AndroidSQLiteDriver.

2.7.0-alpha04

Version 2.7.0-alpha04

Fixed an issue in Room's annotation processor would generate incompatible KMP code when a multi-map return type was defined in a DAO. ( b/340983093) Fixed an issue where Room would fail to find the generated database implementation if the @Database annotated class had no package. ( b/342097292) Fixed an issue where enabling auto-close and multi-instance invalidation would sometimes cause a ConcurrentModificationException when the database was auto-closed due to being idle.

2.7.0-alpha03

Version 2.7.0-alpha03

Fix various issues regarding Kotlin 2.0 and KSP 2.0. Note that Kotlin 2.0 with KSP 2 support is not complete and the team is working on the various APIs and behavior changes in the new compiler. ( b/314151707)

2.7.0-alpha01

Version 2.7.0-alpha01

Kotlin Multiplatform (KMP) Support: In this release, Room has been refactored to become a Kotlin Multiplatform (KMP) library. Although there is still some work to be done, this release introduces a new version of Room where the majority of the functionality has been "common-ized" (made to be multiplatform). Current supported platforms are Android, iOS, JVM (Desktop), native Mac and native Linux. Any missing functionality in the newly supported platforms will be made "feature-complete" in upcoming Room releases. For more information on how to get started using Room KMP, please refer to the official Room KMP documentation. Kotlin Code Generation on KSP has been turned ON by default if processing is done via KSP. For KAPT or Java only projects, Room will still generate Java sources. An overload of Room.databaseBuilder() has been added that takes a lambda parameter that is meant to be used with a Room generated function to avoid using reflection when instantiating the generated RoomDatabase implementation. Example usage is: Room . databaseBuilder ( context = appContext , name = dbFilePath , factory = { MyDatabase :: class . instantiateImpl () } ) An API for configuring a Room with a CoroutineContext has been added to the builder: RoomDatabase.Builder.setQueryCoroutineContext. Note that a RoomDatabase can only be configured with either executors using setQueryExecutor or with a Coroutine context but not both. An API for configuring Room with a SQLite Driver has been added: RoomDatabase.Builder.setDriver(). For more information about the SQLite Driver API refer to the SQLite KMP documentation APIs for accessing the underlying SQLiteConnection from driver APIs have been added: RoomDatabase.useReaderConnection and RoomDatabase.useWriterConnection. Varios Room related callbacks now have an overloaded version that receive SQLiteConnection instead of SupportSQLiteDatabase. These are intended to be overridden when migrating to a KMP project. For more information about migrating Room usages in an Android app to a common KMP module refer to the migration guide. The callbacks are: Migration.migrate(SQLiteConnection) AutoMigrationSpec.onPostMigrate(SQLiteConnection) RoomDatabase.Callback.onCreate(SQLiteConnection) RoomDatabase.Callback.onDestructiveMigration(SQLiteConnection) RoomDatabase.Callback.onOpen(SQLiteConnection) The KTX artifact androidx.room:room-ktx has been merged to androidx.room:room-runtime along with all its APIs, the artifact is now blank. Please remove it from your dependency list.

2.6.1

Version 2.6.1

Resolved issue in generated code where the default value for Double columns in EntityCursorConverter was being set to 0 instead of 0.0. A potential fix for a similar edge-case for Float type columns has also been included. ( Id75f5, b/304584179) Exceptions thrown from PagingSource loads will now be propagated as a LoadStateUpdate of LoadResult.Error containing the Throwable. This error state is observable through PagingDataAdapter.loadStateFlow(Views) or LazyPagingItems.loadState(Compose). Note that this marks a behavioral change where in the past load errors will bubble up as an Exception thrown by the dao method that triggered the load. ( I93887, b/302708983)

2.6.0

Version 2.6.0

The option to enable Kotlin code generation (or "Kotlin CodeGen") is now available in Room KSP. ( 4297ec0). To turn on Kotlin CodeGen in Room, add the room.generateKotlin option name to your processor options for KSP. For more details on how to pass processor options for KSP, see the KSP documentation. Note: When using Kotlin CodeGen, it is important to note that there are additional restrictions that have been added. Abstract properties as DAO getters or DAO queries in Kotlin CodeGen are disallowed, and instead expected to be rewritten as functions to avoid the false notion that the property value is immutable and has a fixed stored result. Another restriction that has been added is that Nullable collection return types are no longer allowed in Room for Kotlin CodeGen. Warning: You may find that your projects are more strict in terms of nullability when using Kotlin CodeGen. In Kotlin CodeGen, the nullability of type arguments is important, wheras in Java this is mostly ignored. For example, let's say you have a Flow return type and the table is empty. In Java CodeGen, this will not cause any issues, but in Kotlin CodeGen, you will get an error. To avoid this, you will need to use Flow , assuming a null is emitted. The new artifact for the Room Gradle Plugin has been added to Room with the id androidx.room, which solves various existing issues in Room regarding having inputs and outputs of schemas via Gradle annotation processor options. For more details, refer to the Room Version 2.6.0-alpha02 release notes. Value classes in Room Entities are now supported for KSP. ( 4194095) Nested Map return types in DAO functions are now supported in Room. ( I13f48, 203008711)

2.6.0-beta01

Version 2.6.0-beta01

Handling the special case SQLite exception during upsert encountered when the 2067 SQLITE_CONSTRAINT_UNIQUE exception is thrown during an upsert, upsert should perform an update. ( If2849, b/243039555)

2.6.0-alpha03

Version 2.6.0-alpha03

Nested Map return types in DAO functions are now supported in Room. ( I13f48, 203008711) A new type annotation called @MapColumn has been created to replace @MapInfo, which is now deprecated. For each column name ( keyColumnName, valueColumnName, or both) provided in a @MapInfo annotation, you will need to declare a @MapColumn annotation with just the columnName and use the annotation on the specific type argument that is being referenced (the key or value of the Map) in the return type of the DAO function. This is because the @MapColumn annotation is used directly on the type argument within the return type of a DAO function, instead of on the function itself like @MapInfo. For more information, please refer to the @MapColumn documentation. ( Ib0305, b/203008711) Updated API files to annotate compatibility suppression ( I8e87a, b/287516207) The Room Gradle plugin APIs have been updated to not always require per-variant configurations. This means that the plugin can accept a global location for all variants without creating multiple directories, enabling smoother migrations that but is also flexible enough to manually configure flavors or build type schemas while still retaining the benefits of the plugin (reproducible and cacheable builds). ( I09d6f, b/278266663) Fixed potential memory leak vulnerability in QueryInterceptorStatement. ( I193d1) Fixed incorrect behavior in the QueryInterceptorDatabase execSQL() function. ( Iefdc8)

2.5.2

Version 2.5.2

Fix an incompatibility issue with the kotlinx-metadata-jvm. ( 386d5c) Fix an issue that causes Room to throw an error when being used in a Robolectric test. ( f79bea, b/274924903)

2.6.0-alpha02

Version 2.6.0-alpha02

This new release contains a new artifact for the Room Gradle Plugin with id androidx.room, which solves various existing issues in Room regarding having inputs and outputs of schemas via Gradle annotation processor options. The Room Gradle Plugin configures the project such that generated schemas that are consumed for auto-migrations and are output of the compile tasks are correctly configured to have reproducible and cacheable builds. The plugin offers a DSL to configure the base schema location:

2.5.1

Version 2.5.1

Avoid checking the database parent directory in FrameworkSQLiteHelper if the database is already open. ( 5de86b8) Use an isOpenInternal check when checking if the database is already open. ( e91fb35) Better handling of the reentrant case in acquireTransactionThread() of Room is now available. ( 219f98b). During a suspending transaction, Room uses a thread from the transaction executor, starts an event loop in it and dispatches suspending database operations to it so they are all encapsulated within the transaction coroutine. It is usually expected that the transaction thread is different from the one starting the transaction, but in some cases they are the same. To handle such reentrant cases the withTransaction() has been refactored to no longer rely on a control job and instead it will execute the suspending transaction block from within the runBlocking in the transaction thread.

2.6.0-alpha01

Version 2.6.0-alpha01

Supporting value classes in Room for KSP. Room is now able to support value classes in Entities. ( 4194095) Kotlin code generation(or "Kotlin CodeGen") can now be enabled in Room ( 4297ec0). To turn on Kotlin CodeGen in Room, add the room.generateKotlin option name to your processor options for KSP. For more details on how to pass processor options for KSP, see the KSP documentation. Note: When using Kotlin CodeGen, it is important to note that there are additional restrictions that have been added. Abstract properties as DAO getters or DAO queries in Kotlin CodeGen are disallowed, and instead expected to be rewritten as functions to avoid the false notion that the property value is immutable and has a fixed stored result. Another restriction that has been added is that Nullable collection return types are no longer allowed in Room for Kotlin CodeGen. Warning: You may find that your projects are more strict in terms of nullability when using Kotlin CodeGen. In Kotlin CodeGen, the nullability of type arguments is important, wheras in Java this is mostly ignored. For example, let's say you have a Flow return type and the table is empty. In Java CodeGen, this will not cause any issues, but in Kotlin CodeGen, you will get an error. To avoid this, you will need to use Flow , assuming a null is emitted. Guarding against meaningless usage of nullable collections in DAO method return types. ( I777dc, b/253271782, b/259426907) Add an API for creating a Flow that emits invalidation tracker changes. The API is useful for creating streams that need to react to database changes. ( I8c790, b/252899305) Disallow abstract properties as DAO getters or DAO queries in Kotlin codegen, instead they should be rewritten as functions to avoid the false notion that the property value is immutable and has a fixed stored result. ( If6a13, b/127483380, b/257967987)

2.5.0

Version 2.5.0

All of room-runtime sources has been converted from Java to Kotlin. Note that you may encounter source incompatibility issues if your code is in Kotlin due to the library conversion to Kotlin. For example, a known source incompatible change is that in InvalidationTracker you will now need to declare onInvalidate() in Observer to have a param of type Set and not MutableSet. Moreover, certain getter methods were converted to properties requiring the property access syntax on Kotlin files. Please file a bug if there are any significant incompatibilities. Added a new shortcut annotation, @Upsert, which attempts to insert an entity when there is no uniqueness conflict or update the entity if there is a conflict. ( I7aaab, b/241964353) New room-paging artifacts room-paging-rxjava2, room-paging-rxjava3 and room-paging-guava have been added for support in Room Paging. Added APIs for providing key and value tables names for disambiguation in @MapInfo ( Icc4b5)

2.5.0-beta02

Version 2.5.0-beta02

Fix various APIs that take query arguments from invariant ( Array<Any?>) to contravariant ( Array<out Any?>) to match Java's array behavior. ( b/253531073)

2.5.0-beta01

Version 2.5.0-beta01

Restrict the minimum version that supports @Upsert to be API 16. This is due to the inability to identity a primary key constraint conflict in older APIs. ( I5f67f, b/243039555) Fixed an issue where shadow tables where incorrectly exported to the schema .json files, corrupting them. ( I4f83b, b/246751839)

2.5.0-alpha03

Version 2.5.0-alpha03

Added a new shortcut annotation, @Upsert, which attempts to insert an entity when there is no uniqueness conflict or update the entity if there is a conflict. ( I7aaab, b/241964353) Room will now throw a SQLiteConstraintException instead of a IllegalStateException during an auto-migration foreign key constraint check. ( I328dd) Fix a Kotlin source incompatible change for getter / properties of getOpenHelper, getQueryExecutor and getTransactionExecutor. ( Iad0ac)

2.4.3

Version 2.4.3

Fixed an issue that would cause Room to not recognize suspend functions in Kotlin 1.7 ( b/236612358)

2.5.0-alpha02

Version 2.5.0-alpha02

New room-paging artifacts room-paging-rxjava2, room-paging-rxjava3 and room-paging-guavahave been added for support in Room Paging.( 41a1d4, b/203666906),( eb6098, b/203666906),( 1b9ae4, b/203666906) All of room-runtime has been converted from Java to Kotlin. ( If2069, b/206859668),( Ie4b55, b/206859668), ( I697ee, b/206859668), ( I96c25, b/206859668) Note: You may encounter source incompatibility issues due to the library conversion to Kotlin. If your code was in Kotlin and calling the old version of Room, the new version will need to handle these cases. For example, a known source incompatible change is that in InvalidationTracker you will now need to declare onInvalidate() in Observer to have a param of type Set and not MutableSet. Added APIs for providing key and value tables names for disambiguation in @MapInfo ( Icc4b5) Fix a source compatibility issue to re-allow @Ignore in property getters. ( Ifc2fb) Duplicate column resolution heuristic algorithm. Room will now attempt to resolve ambiguous columns in a multimap query. This allows for JOINs with tables containing same-name tables to be correctly mapped to a result data object. ( I4b444, b/201306012, b/212279118)

2.5.0-alpha01

Version 2.5.0-alpha01

Fixed an issue where Room @IntDef usage were not being enforced in Kotlin sources. ( I75f41, b/217951311) Fixed a source compatibility issue to re-allow @Query in property getters. ( I0a09b) Converted room-common from Java to Kotlin. ( I69c48, b/206858235) Note: You may encounter source incompatibility issues as some properties have been moved into companion objects during the library conversion to Kotlin. If your code was in Kotlin and calling the old version of Room, the new version will need the ".Companion" suffix when accessing these properties. Converted room-migration from Java to Kotlin. ( I2724b, b/206858622) Converted paging related files in room-runtime from Java to Kotlin. ( I82fc8, b/206859668) Added API for multi-process lock and usage at the FrameworkSQLite* level, to protect multi-process 1st time database creation and migrations. ( Ied267, b/193182592) Added support for internal properties in Kotlin sources. This is a slight behavior change in Room where it will use the source name of functions while matching them to properties as getters/setters (previously, it was using JVM name of the function which is different for internal functions/properties). If you are using custom @JvmName annotations to match getters/setters to private properties, please double check the generated code after the update ( If6531, b/205289020)

2.4.1

Version 2.4.1

Added support for internal properties in Kotlin sources. This is a slight behavior change in Room where it will use the source name of functions while matching them to properties as getters/setters (previously, it was using JVM name of the function which is different for internal functions/properties). If you are using custom @JvmName annotations to match getters/setters to private properties, please double check the generated code after the update

2.4.0

Version 2.4.0

Auto Migrations: Room now offers an API for automatically generating migrations as long as schemas are exported. To let Room know that it should generate an auto-migration a new property @Database#autoMigrations can be used to declare the versions to auto-migrate from and to. When Room needs additional information regarding tables and column renames or deletes, then the @AutoMigration annotation can declare a specification class containing such inputs. Dependency Injection in Auto Migrations: @ProvidedAutoMigrationSpec is a new API for declaring that an AutoMigrationSpec will be provided at runtime via RoomDatabase.Builder#addAutoMigrationSpec(). This allows for a dependency injection framework to provide such specs when they need complex dependencies. Migration Test Helper Support for Auto Migrations: Room's MigrationTestHelper was updated to support auto migrations by providing a new constructor API that receives the database class under test. This allows the helper to automatically add auto migrations the same way during runMigrationsAndValidate. Room-Paging Support: androidx.room:room-paging is released, providing native Paging 3.0 support for Room queries returning androidx.paging.PagingSource. Relational Query Methods: Room now supports multimap return types @Dao methods, useful for JOIN statements. The supported types of multimaps are Map, SparseArray, LongSparseArray, along with Guava's ImmutableMap, ImmutableSetMultimap and ImmutableListMultimap.

2.4.0-beta02

Version 2.4.0-beta02

We've added support for SparseArray and LongSparseArray in @MapInfo. We've added a new TypeConverter analyzer that takes nullability information in types into account. As this information is only available in KSP, it is turned on by default only in KSP. If it causes any issues, you can turn it off by passing room.useNullAwareTypeAnalysis=false to the annotation processor. If that happens, please a file bug as this flag will be removed in the future. With this new TypeConverter analyzer, it is suggested to only provide non-null receiving TypeConverters as the new analyzer has the ability to wrap them with a null check. Note that this has no impact for users using KAPT or Java as the annotation processors (unlike KSP), don't have nullability information in types. Fix a bug where Room would fail to compile with a SQL error when an FTS entity declared to use the ICU tokenizer. Resolved issue in auto migrations regarding a new column added to an embedded Entity between versions. We have resolved an issue regarding the relational query method return types in LEFT JOIN queries. With these changes, in the case where a 1-many mapping is present, the collection returned for a key will not include the invalid value object if it is not found in the cursor. If no valid values are found, then a key will be mapped to an empty collection. Resolved the auto migration issue where SQLite keywords failed to be escaped in column names.

2.4.0-beta01

Version 2.4.0-beta01

Fixed an issue with auto-migrations not adding new columns when another table in the same auto-migration also had a new column with the same name. The PagingSource implementation generated by room-paging now uses the queryExecutor passed through RoomDatabase.Builder, so it can be overridden, instead of Dispatchers.IO previously.

2.4.0-alpha05

Version 2.4.0-alpha05

Added a built-in type converter for UUID. Added a new property to the TypeConverters annotation to let developers disable built-in Enum and UUID converters. By default, these converters are on but you can disable them for a certain scope, or for the whole database. Supporting non-POJO keys/values for Multimap return types in DAOs via the @MapInfo annotation. @MapInfo will be required when the key or value column of the map are from a single column. Make room-paging a required artifact when using Paging3 with Room. Fix an issue where multimap queries results were not correctly ordered when the query contained an ORDER BY clause of a column from the map's key. Added new API to specify index order in @Index.

2.4.0-alpha04

Version 2.4.0-alpha04

Room now supports multimap return types @Dao methods, useful for JOIN statements. The supported types of multimaps are Map along with Guava's ImmutableMap, ImmutableSetMultimap and ImmutableListMultimap. androidx.room:room-paging is released, providing native Paging 3.0 support for Room queries returning androidx.paging.PagingSource. Fix an issue in auto migrations regarding handling foreign key violations.

2.4.0-alpha03

Version 2.4.0-alpha03

Update Room's MigrationTestHelper to support auto migrations by providing a new constructor API that receives the database class under test. This allows the helper to automatically add auto migrations the same way during runMigrationsAndValidate. Fixed an issue with Room's SQLite native library to support Apple's M1 chips. Fixed an issue where Room would not error out when the return type of a @Transaction function was a Flow Fix an issue in auto migrations regarding indices. Room's KSP support now depends on KSP 1.5.10-1.0.0-beta01.

2.4.0-alpha02

Version 2.4.0-alpha02

@ProvidedAutoMigrationSpec is a new API for declaring that an AutoMigrationSpec will be provided at runtime via RoomDatabase.Builder#addAutoMigrationSpec(). This allows for a dependency injection framework to provide such specs when they need complex dependencies. Fix an issue with auto migrations where @DatabaseViews where not being properly re-created. Fix an issue in Room's JournalMode.TRUNCATE where the InvalidationTracker callback was sometimes being invoked invalidly, too late, or not at all.

2.3.0

Version 2.3.0

Built-in Enum Support: Room will now default to using an Enum to String and vice versa type converter if none is provided. If a type converter for an enum already exists, Room will prioritize using it over the default one. Query Callback: Room now offers a general callback API RoomDatabase.QueryCallback, for when queries are about to execute, which can be useful for logging in debug builds. The callback can be set via RoomDatabase.Builder#setQueryCallback(). Pre-packaged Improvement: Room now has APIs for creating a database using a pre-packaged database read from an input stream. This allows for cases such as when the pre-package database is gzipped. Provided Type Converters: Room now has APIs for providing instances of type converters such that the app can control their initialization. To mark a type converter that will be provided to Room use the new annotation @ProvidedTypeConverter. RxJava3 Support: Room now supports RxJava3 types. Similar to RxJava2 you can declare DAO methods whose return type are Flowable, Single, Maybe and Completable. Additionally a new artifact androidx.room:room-rxjava3 is available to support RxJava3. Paging 3.0 Support: Room will now support generating implementations for @Query annotated methods whose return type is androidx.paging.PagingSource.

2.3.0-rc01

Version 2.3.0-rc01

Fix an issue that prevented Coroutine Flow queries created by Room to be consumed in a suspending withTransaction block. ( I797bf)

2.3.0-beta03

Version 2.3.0-beta03

Added incremental compilation support for KSP. ( I031c1, b/176453350) Fixed a bug where creating PagingSource on the main thread could trigger an ANR. ( I42b74, b/181221318) Fixed @ExperimentalRoomApi visibility to be public instead of package private. ( b/181356119) Allow Room to accept a POJO return type in a @Query annotated DAO method when it is also annotated with @SkipQueryVerification. Room will do a best-effort to convert the result of the query to the POJO return type the same way it is done for a @RawQuery annotated DAO method. Thanks to 'Markus Riegel | hey@marcorei.com'. ( I45acb)

2.3.0-beta02

Version 2.3.0-beta02

Room now has experimental support for Kotlin Symbol Processing KSP. KSP is a replacement for KAPT to run annotation processors natively on the Kotlin compiler, significantly reducing build times. To use Room with KSP, you can apply the KSP Gradle plugin and replace the kapt configuration in your build file with ksp. For example, instead of kapt 'androidx.room:room-compiler:2.3.0-beta02' use ksp 'androidx.room:room-compiler:2.3.0-beta02'. See the KSP documentation for more details. Note that since KSP is experimental, it is recommended to still use KAPT for production code. The reduction of build times is only applicable if there are no other processors that use KAPT. See b/160322705 for known issues.

2.3.0-beta01

Version 2.3.0-beta01

Auto Closable Databases: Room now has the ability to close databases that are not accessed after a given amount of time. This is an experimental feature and can be enabled by calling RoomDatabase.Builder#setAutoCloseTimeout(). This feature is useful for applications with multiple databases. Fix an issue where Dao methods with multiple @Update or @Delete methods with different conflict strategies would generate code with only one of the strategies, effectively ignoring the defined one. ( /I0b90d, b/176138543)

2.3.0-alpha04

Version 2.3.0-alpha04

Room now offers a general callback API RoomDatabase.QueryCallback, for when queries are about to execute, which can be useful for logging in debug builds. The callback can be set via RoomDatabase.Builder#setQueryCallback(). ( Iaa513, b/174478034, b/74877608) Room will now default to using an Enum to String and vice versa type converter if none is provided. If a type converter for an enum already exists, Room will prioritize using it over the default one. ( b/73132006) If a one-way type converter for reading already exists for the Enum, Room might accidentally use the built-in String to Enum converter which might not be desired. This is a known issue and can be fixed by making it a two-way converter. See: b/175707691 Fixed an issue where Room would incorrectly disabled incremental annotation processing in newer JDK versions. ( b/171387388) Fixed an issue with Room finding the generated class when multiple class loaders are used. Thanks for the fix 'Serendipity | 892449346@qq.com'! ( b/170141113) Fixed an issue where Room would generate incorrect code when a Kotlin @Dao had a base class whose generics are primitives in the JVM. ( b/160258066) Room will now default to using beginTransactionNonExclusive if WAL mode is enabled and API is 16 or more. Thanks to '

Discussion