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.