Status Update
Comments
ap...@google.com <ap...@google.com> #2
Branch: androidx-main
commit b93b6044308aafa2361f69fe55cd24dbf7b016e6
Author: elifbilgin <elifbilgin@google.com>
Date: Wed Aug 02 08:14:41 2023
Converting `room-common` build files to be AndroidX Multiplatform.
Bug: 299168035
Test: Existing tests
Change-Id: I2b0c00a0d978b45745bf7e94628e2b1ebc6cb66e
M room/room-common/build.gradle
M room/room-common/src/commonMain/kotlin/androidx/room/AmbiguousColumnResolver.kt
M room/room-common/src/commonMain/kotlin/androidx/room/AutoMigration.kt
M room/room-common/src/commonMain/kotlin/androidx/room/BuiltInTypeConverters.kt
M room/room-common/src/commonMain/kotlin/androidx/room/ColumnInfo.kt
M room/room-common/src/commonMain/kotlin/androidx/room/Dao.kt
M room/room-common/src/commonMain/kotlin/androidx/room/Database.kt
M room/room-common/src/commonMain/kotlin/androidx/room/DatabaseView.kt
M room/room-common/src/commonMain/kotlin/androidx/room/Delete.kt
M room/room-common/src/commonMain/kotlin/androidx/room/DeleteColumn.kt
M room/room-common/src/commonMain/kotlin/androidx/room/DeleteTable.kt
M room/room-common/src/commonMain/kotlin/androidx/room/Embedded.kt
M room/room-common/src/commonMain/kotlin/androidx/room/Entity.kt
M room/room-common/src/commonMain/kotlin/androidx/room/ForeignKey.kt
M room/room-common/src/commonMain/kotlin/androidx/room/Fts3.kt
M room/room-common/src/commonMain/kotlin/androidx/room/Fts4.kt
M room/room-common/src/commonMain/kotlin/androidx/room/FtsOptions.kt
M room/room-common/src/commonMain/kotlin/androidx/room/Ignore.kt
M room/room-common/src/commonMain/kotlin/androidx/room/Index.kt
M room/room-common/src/commonMain/kotlin/androidx/room/Insert.kt
M room/room-common/src/commonMain/kotlin/androidx/room/Junction.kt
M room/room-common/src/commonMain/kotlin/androidx/room/MapColumn.kt
M room/room-common/src/commonMain/kotlin/androidx/room/MapInfo.kt
M room/room-common/src/commonMain/kotlin/androidx/room/OnConflictStrategy.kt
M room/room-common/src/commonMain/kotlin/androidx/room/PrimaryKey.kt
M room/room-common/src/commonMain/kotlin/androidx/room/ProvidedAutoMigrationSpec.kt
M room/room-common/src/commonMain/kotlin/androidx/room/ProvidedTypeConverter.kt
M room/room-common/src/commonMain/kotlin/androidx/room/Query.kt
M room/room-common/src/commonMain/kotlin/androidx/room/RawQuery.kt
M room/room-common/src/commonMain/kotlin/androidx/room/Relation.kt
M room/room-common/src/commonMain/kotlin/androidx/room/RenameColumn.kt
M room/room-common/src/commonMain/kotlin/androidx/room/RenameTable.kt
M room/room-common/src/commonMain/kotlin/androidx/room/RewriteQueriesToDropUnusedColumns.kt
M room/room-common/src/commonMain/kotlin/androidx/room/RoomMasterTable.kt
M room/room-common/src/commonMain/kotlin/androidx/room/RoomWarnings.kt
M room/room-common/src/commonMain/kotlin/androidx/room/SkipQueryVerification.kt
M room/room-common/src/commonMain/kotlin/androidx/room/Transaction.kt
M room/room-common/src/commonMain/kotlin/androidx/room/TypeConverter.kt
M room/room-common/src/commonMain/kotlin/androidx/room/TypeConverters.kt
M room/room-common/src/commonMain/kotlin/androidx/room/Update.kt
M room/room-common/src/commonMain/kotlin/androidx/room/Upsert.kt
M room/room-common/src/commonTest/kotlin/androidx/room/AmbiguousColumnResolverTest.kt
M room/room-common/src/commonTest/kotlin/androidx/room/AnnotationRetentionPolicyTest.kt
M settings.gradle
ap...@google.com <ap...@google.com> #3
Branch: androidx-main
commit cd4f81b707004c84a0a31117bffec06ab22dd624
Author: elifbilgin <elifbilgin@google.com>
Date: Tue Nov 28 14:31:43 2023
Adding KMP to room-compiler and room-migration.
Bug: 299168035
Test: ./gradlew bOS
Change-Id: Ic7f785f26007dbc6a1b2d4d9430e889195debd4a
M settings.gradle
ap...@google.com <ap...@google.com> #4
Branch: androidx-main
commit 7cdb294ad4b239a09a5ea51b0a95c6affe899de0
Author: elifbilgin <elifbilgin@google.com>
Date: Thu Aug 03 04:39:03 2023
First steps of making room-runtime KMP.
This CL mainly sets up room-runtime as a KMP project, adding necessary directories for splitting code between commonMain, androidMain and nativeMain. It also updates the relevant gradle files.
This is a starter CL in a row of many more upcoming CLs, but we are looking forward to renovating our Room, even if it means knocking down some walls and adding a few new ones!
Bug: 299168035
Test: Existing integration tests for Room.
Change-Id: I23c90c33e1645385bfb1f55f3843749e4cb76a11
M room/room-runtime/build.gradle
M room/room-runtime/lint-baseline.xml
M room/room-runtime/src/androidInstrumentedTest/kotlin/androidx/room/AutoCloserTest.kt
M room/room-runtime/src/androidInstrumentedTest/kotlin/androidx/room/AutoClosingRoomOpenHelperFactoryTest.kt
M room/room-runtime/src/androidInstrumentedTest/kotlin/androidx/room/AutoClosingRoomOpenHelperTest.kt
M room/room-runtime/src/androidInstrumentedTest/kotlin/androidx/room/RoomOpenHelperTest.java
M room/room-runtime/src/androidInstrumentedTest/kotlin/androidx/room/migration/TableInfoTest.java
M room/room-runtime/src/androidInstrumentedTest/kotlin/androidx/room/migration/ViewInfoTest.java
M room/room-runtime/src/androidInstrumentedTest/kotlin/androidx/room/util/DBUtilTest.java
M room/room-runtime/src/androidMain/AndroidManifest.xml
M room/room-runtime/src/androidMain/kotlin/androidx/room/AutoCloser.android.kt
M room/room-runtime/src/androidMain/kotlin/androidx/room/AutoClosingRoomOpenHelper.android.kt
M room/room-runtime/src/androidMain/kotlin/androidx/room/AutoClosingRoomOpenHelperFactory.android.kt
M room/room-runtime/src/androidMain/kotlin/androidx/room/DatabaseConfiguration.android.kt
M room/room-runtime/src/androidMain/kotlin/androidx/room/DelegatingOpenHelper.android.kt
M room/room-runtime/src/androidMain/kotlin/androidx/room/EntityDeletionOrUpdateAdapter.android.kt
M room/room-runtime/src/androidMain/kotlin/androidx/room/EntityInsertionAdapter.android.kt
M room/room-runtime/src/androidMain/kotlin/androidx/room/EntityUpsertionAdapter.android.kt
M room/room-runtime/src/androidMain/kotlin/androidx/room/ExperimentalRoomApi.android.kt
M room/room-runtime/src/androidMain/kotlin/androidx/room/InvalidationLiveDataContainer.android.kt
M room/room-runtime/src/androidMain/kotlin/androidx/room/InvalidationTracker.android.kt
M room/room-runtime/src/androidMain/kotlin/androidx/room/MultiInstanceInvalidationClient.android.kt
M room/room-runtime/src/androidMain/kotlin/androidx/room/MultiInstanceInvalidationService.android.kt
M room/room-runtime/src/androidMain/kotlin/androidx/room/QueryInterceptorDatabase.android.kt
M room/room-runtime/src/androidMain/kotlin/androidx/room/QueryInterceptorOpenHelper.android.kt
M room/room-runtime/src/androidMain/kotlin/androidx/room/QueryInterceptorOpenHelperFactory.android.kt
M room/room-runtime/src/androidMain/kotlin/androidx/room/QueryInterceptorProgram.android.kt
M room/room-runtime/src/androidMain/kotlin/androidx/room/QueryInterceptorStatement.android.kt
M room/room-runtime/src/androidMain/kotlin/androidx/room/RelationUtil.android.kt
M room/room-runtime/src/androidMain/kotlin/androidx/room/Room.android.kt
M room/room-runtime/src/androidMain/kotlin/androidx/room/RoomDatabase.android.kt
M room/room-runtime/src/androidMain/kotlin/androidx/room/RoomOpenHelper.android.kt
M room/room-runtime/src/androidMain/kotlin/androidx/room/RoomSQLiteQuery.android.kt
M room/room-runtime/src/androidMain/kotlin/androidx/room/RoomTrackingLiveData.android.kt
M room/room-runtime/src/androidMain/kotlin/androidx/room/SQLiteCopyOpenHelper.android.kt
M room/room-runtime/src/androidMain/kotlin/androidx/room/SQLiteCopyOpenHelperFactory.android.kt
M room/room-runtime/src/androidMain/kotlin/androidx/room/SharedSQLiteStatement.android.kt
M room/room-runtime/src/androidMain/kotlin/androidx/room/TransactionExecutor.android.kt
M room/room-runtime/src/androidMain/kotlin/androidx/room/UUIDUtil.android.kt
M room/room-runtime/src/androidMain/kotlin/androidx/room/migration/AutoMigrationSpec.android.kt
M room/room-runtime/src/androidMain/kotlin/androidx/room/migration/Migration.android.kt
M room/room-runtime/src/androidMain/kotlin/androidx/room/package-info.java
M room/room-runtime/src/androidMain/kotlin/androidx/room/util/CursorUtil.android.kt
M room/room-runtime/src/androidMain/kotlin/androidx/room/util/DBUtil.android.kt
M room/room-runtime/src/androidMain/kotlin/androidx/room/util/FileUtil.android.kt
M room/room-runtime/src/androidMain/kotlin/androidx/room/util/FtsTableInfo.android.kt
M room/room-runtime/src/androidMain/kotlin/androidx/room/util/StringUtil.android.kt
M room/room-runtime/src/androidMain/kotlin/androidx/room/util/TableInfo.android.kt
M room/room-runtime/src/androidMain/kotlin/androidx/room/util/ViewInfo.android.kt
M room/room-runtime/src/androidUnitTest/kotlin/androidx/room/BuilderTest.kt
M room/room-runtime/src/androidUnitTest/kotlin/androidx/room/BuilderTest_TestDatabase_Impl.kt
M room/room-runtime/src/androidUnitTest/kotlin/androidx/room/InvalidationLiveDataContainerTest.kt
M room/room-runtime/src/androidUnitTest/kotlin/androidx/room/InvalidationTrackerTest.kt
M room/room-runtime/src/androidUnitTest/kotlin/androidx/room/ObservedTableTrackerTest.kt
M room/room-runtime/src/androidUnitTest/kotlin/androidx/room/RoomSQLiteQueryTest.kt
M room/room-runtime/src/androidUnitTest/kotlin/androidx/room/SQLiteCopyOpenHelperTest.kt
M room/room-runtime/src/androidUnitTest/kotlin/androidx/room/SharedSQLiteStatementTest.kt
M room/room-runtime/src/androidUnitTest/kotlin/androidx/room/TransactionExecutorTest.kt
M room/room-runtime/src/androidUnitTest/kotlin/androidx/room/util/CursorUtilTest.kt
M room/room-runtime/src/androidUnitTest/kotlin/androidx/room/util/FtsTableInfoTest.java
M room/room-runtime/src/androidUnitTest/kotlin/androidx/room/util/StringUtilTest.java
M room/room-runtime/src/androidUnitTest/kotlin/androidx/room/util/UUIDUtilTest.kt
M room/room-runtime/src/androidUnitTest/resources/mockito-extensions/org.mockito.plugins.MockMaker
M settings.gradle
ap...@google.com <ap...@google.com> #5
Branch: androidx-main
commit 6e99114d56924436e78fb266d1d8d6cb433b4d3c
Author: elifbilgin <elifbilgin@google.com>
Date: Wed Nov 29 10:42:33 2023
Adding placeholder files for klib generation in Room-Runtime commonMain.
Bug: 299168035
Test: ./gradlew :room:room-runtime:generateMetadataFileForIosArm64Publication
Change-Id: If899730f16c4158e30e92c0237cbfebf716a54d3
A room/room-runtime/src/commonMain/kotlin/androidx/room/Placeholder.kt
ap...@google.com <ap...@google.com> #6
Branch: androidx-main
commit cbb7dfa939490c964f8735802c8062ff756e328a
Author: Daniel Santiago Rivera <danysantiago@google.com>
Date: Mon Dec 18 16:11:57 2023
Commonize Room initialization and partially migrate to SQLite driver APIs.
A big step towards Room KMP, this change refactors the initialization logic to use driver APIs while maintaining a backwards compatible path for Android users that provide no driver or provide a SupportSQLiteOpenHelper.Factory.
The bulk of the initialization logic that currently resides in RoomOpenHelper and is driven by it implementing SupportSQLiteOpenHelper.Callback has been migrated to a common class named RoomConnectionManager that will be responsible of opening and maintaining database connection including performing migrations if necessary and validating the schema. The generated implementation of createOpenHelper() has been refactored and reduced into RoomOpenDelegate which is an abstract class solely to be implemented by the annotation processor that bridges between code generated logic and runtime. Both of these new classes use the driver APIs.
A chunk of the initialization code is partially converted to use driver APIs, just enough for build and tests to pass as from this point on we can apply a top-down approach to migrating the rest of Room as described in go/sqlite-kmp-room-migration. Similarly only the necessary actual / expect declaration were created for the RoomConnectionManager to contain the common code for initializing the database connection.
Additional relevant changes:
* Added a setter in RoomDatabase.Builder to accept a SQLiteDriver.
* Added an overload of onMigrate() in Migration that has SQLiteConnection as a parameter. The first of many callbacks that need to be migrated.
* Validate in processor that database version is greater than 0. This was already check at runtime in framework logic, but by moving it to processor we can really give version 0 the meaning of a 'newly created database'.
* Added an XPoet API to generated extension function invocations. (Finally! >.>)
* Moved some wrongly located files: RelationUtil.android.kt and UUIDUtil.android.kt.
Bug: 299168035
Bug: 309993778
Test: Existing
Relnote: "Add an API for configuring the SQLiteDriver in Room. Partially move migrations to use SQLiteConnection."
Change-Id: I20dfee013770f55a581ac082d1dd6e1eaa9ac5d7
M room/room-compiler-processing/src/main/java/androidx/room/compiler/codegen/XCodeBlock.kt
M room/room-compiler/src/main/kotlin/androidx/room/ext/xpoet_ext.kt
M room/room-compiler/src/main/kotlin/androidx/room/processor/DatabaseProcessor.kt
M room/room-compiler/src/main/kotlin/androidx/room/processor/ProcessorErrors.kt
M room/room-compiler/src/main/kotlin/androidx/room/writer/DatabaseWriter.kt
M room/room-compiler/src/main/kotlin/androidx/room/writer/FtsTableInfoValidationWriter.kt
M room/room-compiler/src/main/kotlin/androidx/room/writer/OpenDelegateWriter.kt
M room/room-compiler/src/main/kotlin/androidx/room/writer/TableInfoValidationWriter.kt
M room/room-compiler/src/main/kotlin/androidx/room/writer/ValidationWriter.kt
M room/room-compiler/src/main/kotlin/androidx/room/writer/ViewInfoValidationWriter.kt
M room/room-compiler/src/test/kotlin/androidx/room/processor/DatabaseProcessorTest.kt
M room/room-compiler/src/test/kotlin/androidx/room/writer/OpenDelegateWriterTest.kt
M room/room-compiler/src/test/test-data/databasewriter/output/ComplexDatabase.java
M room/room-compiler/src/test/test-data/kotlinCodeGen/database_internalVisibility.kt
M room/room-compiler/src/test/test-data/kotlinCodeGen/database_simple.kt
M room/room-compiler/src/test/test-data/kotlinCodeGen/database_withFtsAndView.kt
M room/room-guava/src/androidTest/java/androidx/room/guava/GuavaRoomTest.java
M room/room-ktx/src/androidTest/java/androidx/room/CoroutineRoomCancellationTest.kt
M room/room-ktx/src/test/java/androidx/room/CoroutinesRoomTest.kt
M room/room-runtime/api/current.txt
M room/room-runtime/api/restricted_current.txt
M room/room-runtime/build.gradle
M room/room-runtime/src/androidMain/kotlin/androidx/room/DatabaseConfiguration.android.kt
A room/room-runtime/src/androidMain/kotlin/androidx/room/RoomAndroidConnectionManager.android.kt
M room/room-runtime/src/androidMain/kotlin/androidx/room/RoomDatabase.android.kt
M room/room-runtime/src/androidMain/kotlin/androidx/room/RoomOpenHelper.android.kt
M room/room-runtime/src/androidMain/kotlin/androidx/room/migration/Migration.android.kt
M room/room-runtime/src/androidMain/kotlin/androidx/room/util/DBUtil.android.kt
M room/room-runtime/src/androidMain/kotlin/androidx/room/util/FtsTableInfo.android.kt
M room/room-runtime/src/androidMain/kotlin/androidx/room/util/RelationUtil.android.kt
M room/room-runtime/src/androidMain/kotlin/androidx/room/util/TableInfo.android.kt
M room/room-runtime/src/androidMain/kotlin/androidx/room/util/UUIDUtil.android.kt
M room/room-runtime/src/androidMain/kotlin/androidx/room/util/ViewInfo.android.kt
M room/room-runtime/src/androidUnitTest/kotlin/androidx/room/BuilderTest.kt
M room/room-runtime/src/androidUnitTest/kotlin/androidx/room/BuilderTest_TestDatabase_Impl.kt
A room/room-runtime/src/commonMain/kotlin/androidx/room/DatabaseConfiguration.kt
A room/room-runtime/src/commonMain/kotlin/androidx/room/RoomConnectionManager.kt
A room/room-runtime/src/commonMain/kotlin/androidx/room/RoomDatabase.kt
A room/room-runtime/src/commonMain/kotlin/androidx/room/RoomOpenDelegate.kt
A room/room-runtime/src/commonMain/kotlin/androidx/room/migration/Migration.kt
A room/room-runtime/src/commonMain/kotlin/androidx/room/util/DBUtil.kt
A room/room-runtime/src/commonMain/kotlin/androidx/room/util/MigrationUtil.kt
M room/room-runtime/src/nativeMain/kotlin/androidx/room/DatabaseConfiguration.native.kt
A room/room-runtime/src/nativeMain/kotlin/androidx/room/RoomConnectionManager.native.kt
A room/room-runtime/src/nativeMain/kotlin/androidx/room/RoomDatabase.native.kt
A room/room-runtime/src/nativeMain/kotlin/androidx/room/migration/Migration.native.kt
M room/room-testing/src/main/java/androidx/room/testing/MigrationTestHelper.kt
ap...@google.com <ap...@google.com> #7
Branch: androidx-main
commit 0a2a14354279a2f02691d5a55f8d7e0951f9c9ba
Author: Daniel Santiago Rivera <danysantiago@google.com>
Date: Tue Dec 19 17:13:42 2023
Commonize Room auto migration validation and initialization.
This change moves auto migration spec validation and auto migration initialization into common code. Generated auto migration related functions had to be mirrored into common code using kotlin.reflect.KClass instead java.lang.Class with a backwards compatible path for old generated code. Reflection assignment checks had to be migrated to an actual/expect function that only does FQN comparison in native which is not quite equivalent as that would fail if a sub-class of the spec is provided, but this might be an unrealistic case. Why would someone provide a subclass of their @ProvidedAutoMigrationSpec? If this is an issue we can enforce @ProvidedAutoMigrationSpec to be final in processor (
Other related changes:
* Added onPostMigrate(connection: SQLiteConnection) but note that such callback is not invoked yet (need to change gen code).
* Migrated relevant concrete collection types in gen code to use Kotlin's Stdlib builders as those are KMP compatible.
* Add XCodeBlock.ofKotlinClassLiteral() to emit KClass literals, note that in Java it converts the java.lang.Class using JvmClassMappingKt but such case should never be generated.
Bug: 299168035
Bug: 309993778
Test: Existing
Relnote: "Add onPostMigrate(connection: SQLiteConnection) to AutoMigrationSpec"
Change-Id: I3b7c9219f6ba79056633530b052d3ce54f013940
M room/room-common/build.gradle
M room/room-compiler-processing/src/main/java/androidx/room/compiler/codegen/XCodeBlock.kt
M room/room-compiler/src/main/kotlin/androidx/room/ext/xpoet_ext.kt
M room/room-compiler/src/main/kotlin/androidx/room/writer/DatabaseWriter.kt
M room/room-compiler/src/test/test-data/databasewriter/output/ComplexDatabase.java
M room/room-compiler/src/test/test-data/kotlinCodeGen/database_internalVisibility.kt
M room/room-compiler/src/test/test-data/kotlinCodeGen/database_simple.kt
M room/room-compiler/src/test/test-data/kotlinCodeGen/database_withFtsAndView.kt
M room/room-runtime/api/current.txt
M room/room-runtime/api/restricted_current.txt
M room/room-runtime/src/androidMain/kotlin/androidx/room/DatabaseConfiguration.android.kt
M room/room-runtime/src/androidMain/kotlin/androidx/room/RoomDatabase.android.kt
M room/room-runtime/src/androidMain/kotlin/androidx/room/migration/AutoMigrationSpec.android.kt
A room/room-runtime/src/androidMain/kotlin/androidx/room/util/KClassUtil.android.kt
M room/room-runtime/src/androidUnitTest/kotlin/androidx/room/BuilderTest_TestDatabase_Impl.kt
M room/room-runtime/src/commonMain/kotlin/androidx/room/DatabaseConfiguration.kt
M room/room-runtime/src/commonMain/kotlin/androidx/room/RoomDatabase.kt
A room/room-runtime/src/commonMain/kotlin/androidx/room/migration/AutoMigrationSpec.kt
A room/room-runtime/src/commonMain/kotlin/androidx/room/util/KClassUtil.kt
M room/room-runtime/src/commonMain/kotlin/androidx/room/util/MigrationUtil.kt
M room/room-runtime/src/nativeMain/kotlin/androidx/room/DatabaseConfiguration.native.kt
M room/room-runtime/src/nativeMain/kotlin/androidx/room/RoomDatabase.native.kt
A room/room-runtime/src/nativeMain/kotlin/androidx/room/migration/AutoMigrationSpec.native.kt
A room/room-runtime/src/nativeMain/kotlin/androidx/room/util/KClassUtil.kt
M room/room-testing/src/main/java/androidx/room/testing/MigrationTestHelper.kt
ap...@google.com <ap...@google.com> #8
Branch: androidx-main
commit a362ded886d8e875afe2f5dea11e3666514d3210
Author: Daniel Santiago Rivera <danysantiago@google.com>
Date: Wed Dec 20 18:06:43 2023
Commonize journal mode setup
For backwards compatibility, it is set in the SupportSQLiteOpenHelper, otherwise the PRAGMA statement is invoked when the connection is opened. Note that AUTOMATIC will only be available in Android as only there we can use 'low-ram device' APIs to figure out mode.
Also add init(config DatabaseConfiguration) to RoomDatabase.native as that will eventually be invoked by the builder.
Bug: 299168035
Bug: 309993778
Test: Existing
Change-Id: I79eb6a54e4f5d02431643964ff70511f36993e67
M room/room-runtime/src/androidMain/kotlin/androidx/room/DatabaseConfiguration.android.kt
M room/room-runtime/src/androidMain/kotlin/androidx/room/RoomAndroidConnectionManager.android.kt
M room/room-runtime/src/androidMain/kotlin/androidx/room/RoomDatabase.android.kt
M room/room-runtime/src/commonMain/kotlin/androidx/room/DatabaseConfiguration.kt
M room/room-runtime/src/commonMain/kotlin/androidx/room/RoomConnectionManager.kt
M room/room-runtime/src/commonMain/kotlin/androidx/room/RoomDatabase.kt
M room/room-runtime/src/nativeMain/kotlin/androidx/room/DatabaseConfiguration.native.kt
M room/room-runtime/src/nativeMain/kotlin/androidx/room/RoomDatabase.native.kt
ap...@google.com <ap...@google.com> #9
Branch: androidx-main
commit 691d576d85780abaf6b4ad3b7fa756d6a48673b2
Author: Daniel Santiago Rivera <danysantiago@google.com>
Date: Wed Dec 20 13:33:24 2023
Commonize Room provided type converters validation and initialization.
This change moves type converter validation into common code. Generated type converter related functions had to be mirrored into common code using kotlin.reflect.KClass instead java.lang.Class with a backwards compatible path for old generated code. The same strategy as auto migration specs was used for assignability checks due to the lack of reflection in native code.
Bug: 299168035
Bug: 309993778
Test: Existing
Relnote: "Deprecate getTypeConverter() that uses java.lang.Class since it is not compatible with KMP, a same-name function that uses KClass was added to replace it."
Change-Id: I9a9bcc4cb7386dd8258b577ef0b5881ae1f5d53b
M room/room-compiler/src/main/kotlin/androidx/room/solver/types/CustomTypeConverterWrapper.kt
M room/room-compiler/src/main/kotlin/androidx/room/writer/DaoWriter.kt
M room/room-compiler/src/main/kotlin/androidx/room/writer/DatabaseWriter.kt
M room/room-compiler/src/test/test-data/databasewriter/output/ComplexDatabase.java
M room/room-compiler/src/test/test-data/kotlinCodeGen/abstractClassWithParam.kt
M room/room-compiler/src/test/test-data/kotlinCodeGen/arrayParameterAdapter.kt
M room/room-compiler/src/test/test-data/kotlinCodeGen/basicParameterAdapter_string.kt
M room/room-compiler/src/test/test-data/kotlinCodeGen/callableQuery_rx2.kt
M room/room-compiler/src/test/test-data/kotlinCodeGen/callableQuery_rx3.kt
M room/room-compiler/src/test/test-data/kotlinCodeGen/collectionParameterAdapter_string.kt
M room/room-compiler/src/test/test-data/kotlinCodeGen/coroutineResultBinder.kt
M room/room-compiler/src/test/test-data/kotlinCodeGen/coroutines.kt
M room/room-compiler/src/test/test-data/kotlinCodeGen/database_internalVisibility.kt
M room/room-compiler/src/test/test-data/kotlinCodeGen/database_simple.kt
M room/room-compiler/src/test/test-data/kotlinCodeGen/database_withFtsAndView.kt
M room/room-compiler/src/test/test-data/kotlinCodeGen/delegatingFunctions_boxedPrimitiveBridge.kt
M room/room-compiler/src/test/test-data/kotlinCodeGen/delegatingFunctions_defaultImplBridge.kt
M room/room-compiler/src/test/test-data/kotlinCodeGen/deleteOrUpdateMethodAdapter.kt
M room/room-compiler/src/test/test-data/kotlinCodeGen/entityRowAdapter.kt
M room/room-compiler/src/test/test-data/kotlinCodeGen/guavaCallable.kt
M room/room-compiler/src/test/test-data/kotlinCodeGen/insertOrUpsertMethodAdapter.kt
M room/room-compiler/src/test/test-data/kotlinCodeGen/liveDataCallable.kt
M room/room-compiler/src/test/test-data/kotlinCodeGen/multiTypedPagingSourceResultBinder.kt
M room/room-compiler/src/test/test-data/kotlinCodeGen/paging_dataSource.kt
M room/room-compiler/src/test/test-data/kotlinCodeGen/pojoRowAdapter_boolean.kt
M room/room-compiler/src/test/test-data/kotlinCodeGen/pojoRowAdapter_byteArray.kt
M room/room-compiler/src/test/test-data/kotlinCodeGen/pojoRowAdapter_customTypeConverter.kt
M room/room-compiler/src/test/test-data/kotlinCodeGen/pojoRowAdapter_customTypeConverter_composite.kt
M room/room-compiler/src/test/test-data/kotlinCodeGen/pojoRowAdapter_customTypeConverter_internalVisibility.kt
M room/room-compiler/src/test/test-data/kotlinCodeGen/pojoRowAdapter_customTypeConverter_nullAware.kt
M room/room-compiler/src/test/test-data/kotlinCodeGen/pojoRowAdapter_customTypeConverter_provided.kt
M room/room-compiler/src/test/test-data/kotlinCodeGen/pojoRowAdapter_embedded.kt
M room/room-compiler/src/test/test-data/kotlinCodeGen/pojoRowAdapter_enum.kt
M room/room-compiler/src/test/test-data/kotlinCodeGen/pojoRowAdapter_internalVisibility.kt
M room/room-compiler/src/test/test-data/kotlinCodeGen/pojoRowAdapter_otherModule.kt
M room/room-compiler/src/test/test-data/kotlinCodeGen/pojoRowAdapter_primitives.kt
M room/room-compiler/src/test/test-data/kotlinCodeGen/pojoRowAdapter_primitives_nullable.kt
M room/room-compiler/src/test/test-data/kotlinCodeGen/pojoRowAdapter_string.kt
M room/room-compiler/src/test/test-data/kotlinCodeGen/pojoRowAdapter_uuid.kt
M room/room-compiler/src/test/test-data/kotlinCodeGen/pojoRowAdapter_valueClassConverter.kt
M room/room-compiler/src/test/test-data/kotlinCodeGen/pojoRowAdapter_variableProperty.kt
M room/room-compiler/src/test/test-data/kotlinCodeGen/pojoRowAdapter_variableProperty_java.kt
M room/room-compiler/src/test/test-data/kotlinCodeGen/preparedCallableQuery_rx2.kt
M room/room-compiler/src/test/test-data/kotlinCodeGen/preparedCallableQuery_rx3.kt
M room/room-compiler/src/test/test-data/kotlinCodeGen/preparedQueryAdapter.kt
M room/room-compiler/src/test/test-data/kotlinCodeGen/queryResultAdapter_array.kt
M room/room-compiler/src/test/test-data/kotlinCodeGen/queryResultAdapter_guavaImmutableMap.kt
M room/room-compiler/src/test/test-data/kotlinCodeGen/queryResultAdapter_guavaImmutableMultimap.kt
M room/room-compiler/src/test/test-data/kotlinCodeGen/queryResultAdapter_guavaOptional.kt
M room/room-compiler/src/test/test-data/kotlinCodeGen/queryResultAdapter_immutable_list.kt
M room/room-compiler/src/test/test-data/kotlinCodeGen/queryResultAdapter_list.kt
M room/room-compiler/src/test/test-data/kotlinCodeGen/queryResultAdapter_map.kt
M room/room-compiler/src/test/test-data/kotlinCodeGen/queryResultAdapter_map_ambiguousIndexAdapter.kt
M room/room-compiler/src/test/test-data/kotlinCodeGen/queryResultAdapter_nestedMap.kt
M room/room-compiler/src/test/test-data/kotlinCodeGen/queryResultAdapter_nestedMap_ambiguousIndexAdapter.kt
M room/room-compiler/src/test/test-data/kotlinCodeGen/queryResultAdapter_optional.kt
M room/room-compiler/src/test/test-data/kotlinCodeGen/rawQuery.kt
M room/room-compiler/src/test/test-data/kotlinCodeGen/relations.kt
M room/room-compiler/src/test/test-data/kotlinCodeGen/relations_arrayMap.kt
M room/room-compiler/src/test/test-data/kotlinCodeGen/relations_byteBufferKey.kt
M room/room-compiler/src/test/test-data/kotlinCodeGen/relations_longSparseArray.kt
M room/room-compiler/src/test/test-data/kotlinCodeGen/relations_nullable.kt
M room/room-compiler/src/test/test-data/kotlinCodeGen/shortcutMethods_rx2.kt
M room/room-compiler/src/test/test-data/kotlinCodeGen/shortcutMethods_rx3.kt
M room/room-compiler/src/test/test-data/kotlinCodeGen/shortcutMethods_suspend.kt
M room/room-compiler/src/test/test-data/kotlinCodeGen/transactionMethodAdapter_abstractClass.kt
M room/room-compiler/src/test/test-data/kotlinCodeGen/transactionMethodAdapter_interface.kt
M room/room-runtime/api/current.txt
M room/room-runtime/api/restricted_current.txt
M room/room-runtime/src/androidMain/kotlin/androidx/room/DatabaseConfiguration.android.kt
M room/room-runtime/src/androidMain/kotlin/androidx/room/RoomDatabase.android.kt
M room/room-runtime/src/commonMain/kotlin/androidx/room/DatabaseConfiguration.kt
M room/room-runtime/src/commonMain/kotlin/androidx/room/RoomDatabase.kt
M room/room-runtime/src/nativeMain/kotlin/androidx/room/DatabaseConfiguration.native.kt
M room/room-runtime/src/nativeMain/kotlin/androidx/room/RoomDatabase.native.kt
ap...@google.com <ap...@google.com> #10
Branch: androidx-main
commit 589d5f1c813ba96f58a63f3d6b7f461c4768dfc7
Author: Daniel Santiago Rivera <danysantiago@google.com>
Date: Tue Jan 09 20:30:53 2024
Add JVM target and source sets to room-runtime
Along with all the actual declarations from their expect counterparts in common.
Bug: 299168035
Test: ./gradlew room:room-runtime:allTests
Change-Id: I2a4fc24ee46636ca4adf3b3cb3400aac0af6f60e
M room/room-runtime/build.gradle
A room/room-runtime/src/jvmMain/kotlin/androidx/room/DatabaseConfiguration.jvm.kt
A room/room-runtime/src/jvmMain/kotlin/androidx/room/RoomDatabase.jvm.kt
A room/room-runtime/src/jvmMain/kotlin/androidx/room/RoomJvmConnectionManager.jvm.kt
A room/room-runtime/src/jvmMain/kotlin/androidx/room/concurrent/ThreadLocal.jvm.kt
A room/room-runtime/src/jvmMain/kotlin/androidx/room/migration/AutoMigrationSpec.jvm.kt
A room/room-runtime/src/jvmMain/kotlin/androidx/room/migration/Migration.jvm.kt
A room/room-runtime/src/jvmMain/kotlin/androidx/room/util/KClassUtil.jvm.kt
A room/room-runtime/src/jvmTest/kotlin/androidx/room/coroutines/BundledSQLiteConnectionPoolTest.kt
ap...@google.com <ap...@google.com> #11
Branch: androidx-main
commit feeadc029f4b2cf7c3ab1cb096179ac08616b49f
Author: Daniel Santiago Rivera <danysantiago@google.com>
Date: Thu Jan 25 13:23:49 2024
Fix compatibility mode callbacks when new room-runtime is combined with old gen code.
Specifically, when old generated code is used with new room-runtime there is no OpenDelegate and instead the runtime is forced to use RoomOpenHelper which invokes the various RoomDatabase.Callback provided and stores a reference to the SupportSQLiteDatabase for isOpenInternal() and other APIs. When the connection manager was added, compatibility mode was also added but it missed extracting SupportSQLiteDatabase from the generated delegate used in the RoomOpenHelper which in turn broke invalidation tracker. This CL fixes the problem by installing a onOpen callback so that the connection manager can extract the database reference. It also moves callback invocation to the RoomOpenHelper instead of the generated code as RoomDatabase.mCallbacks is no longer set during initialization.
To further protect KMP changes the a flavor was added to Room's Java integration app so that all tests are run with a pre-KMP version of the annotation processor but with the new runtime. This scenario is likely to occur with an app using WorkManager and Room together.
Bug: 299168035
Bug: 316636123
Bug: 321297252
Test: ./gradlew :room:integration-tests:room-testapp:cAT
Change-Id: Ib139938e8f0e9557678432d36e7e284e8b257ad3
M room/integration-tests/testapp/build.gradle
M room/integration-tests/testapp/src/androidTest/java/androidx/room/integration/testapp/TestDatabase.java
D room/integration-tests/testapp/src/androidTest/java/androidx/room/integration/testapp/dao/RecordEntityDao.java
M room/integration-tests/testapp/src/androidTest/java/androidx/room/integration/testapp/migration/MigrationTest.java
M room/integration-tests/testapp/src/androidTest/java/androidx/room/integration/testapp/test/PojoTest.java
D room/integration-tests/testapp/src/androidTest/java/androidx/room/integration/testapp/vo/RecordEntity.java
A room/integration-tests/testapp/src/androidTestWithNullAwareTypeConverter/java/androidx/room/integration/test/RecordPojoTest.java
M room/room-runtime/src/androidMain/kotlin/androidx/room/DatabaseConfiguration.android.kt
M room/room-runtime/src/androidMain/kotlin/androidx/room/RoomAndroidConnectionManager.android.kt
M room/room-runtime/src/androidMain/kotlin/androidx/room/RoomDatabase.android.kt
M room/room-runtime/src/androidMain/kotlin/androidx/room/RoomOpenHelper.android.kt
ap...@google.com <ap...@google.com> #12
Branch: androidx-main
commit d46fb4f9bf1fe401b0281084afbaaa4718bcd594
Author: Daniel Santiago Rivera <danysantiago@google.com>
Date: Fri Jan 19 14:10:04 2024
Partially migrate @Query codegen path to use Driver API
Specifically InstantQueryResultBinder, SingleItemQueryResultAdapter, PojoRowAdapter (without relations) and most of column type adapters. The migrated codegen path is for blocking DAO functions, these will be support on Android only for backwards compatibility through utility functions that use the connection pool while blocking the calling thread. The flag `useDriverApi` in CodeGenScope helps writers decide which API is to generate and the various migration lists in the binders and adapters help us incrementally migrate the codegen.
Generated code relies on finding column indices before the first statement step but this slightly differed in the Android driver due to such information only being available on execution, to align behaviour, the Android driver will now execute the statement if column information is requested. Moreover, ensure usePrepared() closes the statement / cursor in the compatibility pool.
Bug: 299168035
Bug: 309995680
Test: Existing
Relnote: "Add restricted common APIs to perform database operation using the connection pool from gencode."
Change-Id: Idf8c3aaae48949ead7ff8d3f179fa29276f738bd
M room/room-compiler/src/main/kotlin/androidx/room/ext/xpoet_ext.kt
M room/room-compiler/src/main/kotlin/androidx/room/solver/CodeGenScope.kt
M room/room-compiler/src/main/kotlin/androidx/room/solver/query/result/InstantQueryResultBinder.kt
M room/room-compiler/src/main/kotlin/androidx/room/solver/query/result/PojoIndexAdapter.kt
M room/room-compiler/src/main/kotlin/androidx/room/solver/query/result/PojoRowAdapter.kt
M room/room-compiler/src/main/kotlin/androidx/room/solver/query/result/QueryResultAdapter.kt
M room/room-compiler/src/main/kotlin/androidx/room/solver/query/result/QueryResultBinder.kt
M room/room-compiler/src/main/kotlin/androidx/room/solver/query/result/RowAdapter.kt
M room/room-compiler/src/main/kotlin/androidx/room/solver/query/result/SingleItemQueryResultAdapter.kt
M room/room-compiler/src/main/kotlin/androidx/room/solver/types/EnumColumnTypeAdapter.kt
M room/room-compiler/src/main/kotlin/androidx/room/solver/types/PrimitiveColumnTypeAdapter.kt
M room/room-compiler/src/main/kotlin/androidx/room/solver/types/StringColumnTypeAdapter.kt
M room/room-compiler/src/main/kotlin/androidx/room/writer/DaoWriter.kt
M room/room-compiler/src/test/test-data/daoWriter/output/javac/ComplexDao.java
M room/room-compiler/src/test/test-data/daoWriter/output/ksp/ComplexDao.java
M room/room-compiler/src/test/test-data/kotlinCodeGen/abstractClassWithParam.kt
M room/room-compiler/src/test/test-data/kotlinCodeGen/arrayParameterAdapter.kt
M room/room-compiler/src/test/test-data/kotlinCodeGen/basicParameterAdapter_string.kt
M room/room-compiler/src/test/test-data/kotlinCodeGen/collectionParameterAdapter_string.kt
M room/room-compiler/src/test/test-data/kotlinCodeGen/delegatingFunctions_boxedPrimitiveBridge.kt
M room/room-compiler/src/test/test-data/kotlinCodeGen/delegatingFunctions_defaultImplBridge.kt
M room/room-compiler/src/test/test-data/kotlinCodeGen/pojoRowAdapter_boolean.kt
M room/room-compiler/src/test/test-data/kotlinCodeGen/pojoRowAdapter_byteArray.kt
M room/room-compiler/src/test/test-data/kotlinCodeGen/pojoRowAdapter_customTypeConverter.kt
M room/room-compiler/src/test/test-data/kotlinCodeGen/pojoRowAdapter_customTypeConverter_composite.kt
M room/room-compiler/src/test/test-data/kotlinCodeGen/pojoRowAdapter_customTypeConverter_internalVisibility.kt
M room/room-compiler/src/test/test-data/kotlinCodeGen/pojoRowAdapter_customTypeConverter_nullAware.kt
M room/room-compiler/src/test/test-data/kotlinCodeGen/pojoRowAdapter_customTypeConverter_provided.kt
M room/room-compiler/src/test/test-data/kotlinCodeGen/pojoRowAdapter_embedded.kt
M room/room-compiler/src/test/test-data/kotlinCodeGen/pojoRowAdapter_enum.kt
M room/room-compiler/src/test/test-data/kotlinCodeGen/pojoRowAdapter_internalVisibility.kt
M room/room-compiler/src/test/test-data/kotlinCodeGen/pojoRowAdapter_otherModule.kt
M room/room-compiler/src/test/test-data/kotlinCodeGen/pojoRowAdapter_primitives.kt
M room/room-compiler/src/test/test-data/kotlinCodeGen/pojoRowAdapter_primitives_nullable.kt
M room/room-compiler/src/test/test-data/kotlinCodeGen/pojoRowAdapter_string.kt
M room/room-compiler/src/test/test-data/kotlinCodeGen/pojoRowAdapter_uuid.kt
M room/room-compiler/src/test/test-data/kotlinCodeGen/pojoRowAdapter_valueClassConverter.kt
M room/room-compiler/src/test/test-data/kotlinCodeGen/pojoRowAdapter_variableProperty.kt
M room/room-compiler/src/test/test-data/kotlinCodeGen/pojoRowAdapter_variableProperty_java.kt
M room/room-runtime/api/restricted_current.txt
M room/room-runtime/src/androidMain/kotlin/androidx/room/RoomAndroidConnectionManager.android.kt
M room/room-runtime/src/androidMain/kotlin/androidx/room/RoomDatabase.android.kt
M room/room-runtime/src/androidMain/kotlin/androidx/room/driver/SupportSQLiteStatement.android.kt
M room/room-runtime/src/androidMain/kotlin/androidx/room/util/DBUtil.android.kt
A room/room-runtime/src/androidMain/kotlin/androidx/room/util/StatementUtil.android.kt
M room/room-runtime/src/commonMain/kotlin/androidx/room/RoomDatabase.kt
A room/room-runtime/src/commonMain/kotlin/androidx/room/util/StatementUtil.kt
M room/room-runtime/src/jvmMain/kotlin/androidx/room/RoomDatabase.jvm.kt
A room/room-runtime/src/jvmMain/kotlin/androidx/room/util/StatementUtil.jvm.kt
M room/room-runtime/src/nativeMain/kotlin/androidx/room/RoomDatabase.native.kt
M room/room-runtime/src/nativeMain/kotlin/androidx/room/util/KClassUtil.native.kt
A room/room-runtime/src/nativeMain/kotlin/androidx/room/util/StatementUtil.native.kt
M sqlite/integration-tests/driver-conformance-test/src/commonTest/kotlin/androidx/sqlite/driver/test/BaseConformanceTest.kt
M sqlite/sqlite-framework/src/androidMain/kotlin/androidx/sqlite/driver/AndroidSQLiteStatement.android.kt
ap...@google.com <ap...@google.com> #13
Branch: androidx-main
commit 8c7ac929b176c3dcb5dacd7669ae5f46ed0438a0
Author: Daniel Santiago Rivera <danysantiago@google.com>
Date: Wed Jan 24 11:24:19 2024
Commonize RoomDatabase.clearAllTable()
By 'commonize', I mean only generate an override implementation for Android as RoomDatabase.android.kt only declares clearAllTable(). Being a blocking function it won't be moved to common API for now. The generated code was still updated to use Driver API and the bulk of the implementation was moved to a runtime function.
Also fix SupportPooledConnection not marking a transaction successful.
Bug: 299168035
Test: Existing
Change-Id: I53820fe87cf3ed34003829c975e4cc5ca44f7d50
M room/room-compiler/src/main/kotlin/androidx/room/processor/DatabaseProcessor.kt
M room/room-compiler/src/main/kotlin/androidx/room/vo/Database.kt
M room/room-compiler/src/main/kotlin/androidx/room/writer/DatabaseWriter.kt
M room/room-compiler/src/test/kotlin/androidx/room/verifier/DatabaseVerifierTest.kt
M room/room-compiler/src/test/kotlin/androidx/room/vo/DatabaseTest.kt
M room/room-compiler/src/test/test-data/databasewriter/output/ComplexDatabase.java
M room/room-compiler/src/test/test-data/kotlinCodeGen/database_internalVisibility.kt
M room/room-compiler/src/test/test-data/kotlinCodeGen/database_simple.kt
M room/room-compiler/src/test/test-data/kotlinCodeGen/database_withFtsAndView.kt
M room/room-runtime/src/androidMain/kotlin/androidx/room/RoomAndroidConnectionManager.android.kt
M room/room-runtime/src/androidMain/kotlin/androidx/room/RoomDatabase.android.kt
M room/room-runtime/src/androidMain/kotlin/androidx/room/util/DBUtil.android.kt
ap...@google.com <ap...@google.com> #14
Branch: androidx-main
commit 10b882bfaf720ed636dc8948ff2cfdb38a678a9d
Author: Daniel Santiago Rivera <danysantiago@google.com>
Date: Wed Jan 24 09:32:27 2024
Commonize TableInfo, FtsTableInfo and ViewInfo
For backwards compatibility the classes are now actual / expect declarations with most of the common code moved to internal extension functions to avoid duplication yet keeping ABI compatibility. The generated code of onValidateSchema() has also been refactored to remove usages of Java collections in the database writer.
Due to
Bug: 299168035
Bug: 309995680
Test: Existing
Change-Id: Idf97315d2b80f80759b2762761ad3c211a600e88
M room/integration-tests/kotlintestapp/src/androidTest/java/androidx/room/integration/kotlintestapp/migration/AutoMigrationTest.kt
M room/integration-tests/kotlintestapp/src/androidTest/java/androidx/room/integration/kotlintestapp/migration/MigrationKotlinTest.kt
M room/room-compiler/src/main/kotlin/androidx/room/writer/FtsTableInfoValidationWriter.kt
M room/room-compiler/src/main/kotlin/androidx/room/writer/TableInfoValidationWriter.kt
M room/room-compiler/src/test/test-data/databasewriter/output/ComplexDatabase.java
M room/room-compiler/src/test/test-data/kotlinCodeGen/database_internalVisibility.kt
M room/room-compiler/src/test/test-data/kotlinCodeGen/database_simple.kt
M room/room-compiler/src/test/test-data/kotlinCodeGen/database_withFtsAndView.kt
A room/room-runtime/api/restricted_current.ignore
M room/room-runtime/api/restricted_current.txt
M room/room-runtime/src/androidInstrumentedTest/kotlin/androidx/room/migration/TableInfoTest.java
M room/room-runtime/src/androidMain/kotlin/androidx/room/util/FtsTableInfo.android.kt
M room/room-runtime/src/androidMain/kotlin/androidx/room/util/TableInfo.android.kt
M room/room-runtime/src/androidMain/kotlin/androidx/room/util/ViewInfo.android.kt
D room/room-runtime/src/androidUnitTest/kotlin/androidx/room/util/FtsTableInfoTest.java
A room/room-runtime/src/androidUnitTest/kotlin/androidx/room/util/FtsTableInfoTest.kt
A room/room-runtime/src/commonMain/kotlin/androidx/room/util/FtsTableInfo.kt
A room/room-runtime/src/commonMain/kotlin/androidx/room/util/SchemaInfoUtil.kt
A room/room-runtime/src/commonMain/kotlin/androidx/room/util/TableInfo.kt
A room/room-runtime/src/commonMain/kotlin/androidx/room/util/ViewInfo.kt
A room/room-runtime/src/jvmMain/kotlin/androidx/room/util/FtsTableInfo.jvm.kt
A room/room-runtime/src/jvmMain/kotlin/androidx/room/util/TableInfo.jvm.kt
A room/room-runtime/src/jvmMain/kotlin/androidx/room/util/ViewInfo.jvm.kt
A room/room-runtime/src/nativeMain/kotlin/androidx/room/util/FtsTableInfo.native.kt
A room/room-runtime/src/nativeMain/kotlin/androidx/room/util/TableInfo.native.kt
A room/room-runtime/src/nativeMain/kotlin/androidx/room/util/ViewInfo.native.kt
ap...@google.com <ap...@google.com> #15
Branch: androidx-main
commit 93d98afa5bf2f4f9c0a5dbd4046bfbba167b4cae
Author: Daniel Santiago Rivera <danysantiago@google.com>
Date: Fri Jan 26 10:22:38 2024
Partially commonize InvalidationTracker
Just enough commonization so that we can generate valid KMP code and remove the last remaining Java collections usages in the database writer.
Bug: 299168035
Bug: 309990302
Test: Existing
Change-Id: I9aa3909085d910d708ed84f21a813c242175c94b
M room/room-compiler/src/main/kotlin/androidx/room/writer/DatabaseWriter.kt
M room/room-compiler/src/test/test-data/databasewriter/output/ComplexDatabase.java
M room/room-compiler/src/test/test-data/kotlinCodeGen/database_internalVisibility.kt
M room/room-compiler/src/test/test-data/kotlinCodeGen/database_simple.kt
M room/room-compiler/src/test/test-data/kotlinCodeGen/database_withFtsAndView.kt
M room/room-runtime/api/restricted_current.txt
M room/room-runtime/src/androidMain/kotlin/androidx/room/InvalidationTracker.android.kt
M room/room-runtime/src/androidMain/kotlin/androidx/room/RoomDatabase.android.kt
M room/room-runtime/src/androidUnitTest/kotlin/androidx/room/InvalidationTrackerTest.kt
A room/room-runtime/src/commonMain/kotlin/androidx/room/InvalidationTracker.kt
M room/room-runtime/src/commonMain/kotlin/androidx/room/RoomDatabase.kt
A room/room-runtime/src/jvmMain/kotlin/androidx/room/InvalidationTracker.jvm.kt
M room/room-runtime/src/jvmMain/kotlin/androidx/room/RoomDatabase.jvm.kt
A room/room-runtime/src/nativeMain/kotlin/androidx/room/InvalidationTracker.native.kt
M room/room-runtime/src/nativeMain/kotlin/androidx/room/RoomDatabase.native.kt
M room/room-runtime/src/nativeTest/kotlin/androidx.room/BuilderTest_TestDatabase_Impl.kt
ap...@google.com <ap...@google.com> #16
Branch: androidx-main
commit 30651b75aba382ccfa9675433dd2a0762b44430e
Author: Daniel Santiago Rivera <danysantiago@google.com>
Date: Fri Jan 26 11:52:13 2024
Migrate CoroutineResultBinder to driver API
CoroutinesRoom.execute() has been replaced by DBUtil.performSuspending() equivalent API that will use the connection pool but will fallback to the same behaviour as CoroutinesRoom if Room is in compatibility mode.
Bug: 299168035
Test: Existing
Change-Id: I2283b94fd8f198c875b87d7064bd6e2ee4613fa4
M room/room-compiler/src/main/kotlin/androidx/room/solver/query/result/CoroutineResultBinder.kt
M room/room-compiler/src/test/test-data/kotlinCodeGen/coroutineResultBinder.kt
M room/room-runtime/api/restricted_current.txt
M room/room-runtime/src/androidMain/kotlin/androidx/room/CoroutinesRoom.android.kt
M room/room-runtime/src/androidMain/kotlin/androidx/room/RoomDatabase.android.kt
M room/room-runtime/src/androidMain/kotlin/androidx/room/util/DBUtil.android.kt
M room/room-runtime/src/commonMain/kotlin/androidx/room/util/DBUtil.kt
A room/room-runtime/src/jvmMain/kotlin/androidx/room/util/DBUtil.jvm.kt
A room/room-runtime/src/nativeMain/kotlin/androidx/room/util/DBUtil.native.kt
ap...@google.com <ap...@google.com> #17
Branch: androidx-main
commit 3340764457d00e6df508922b652f090276f5937e
Author: Daniel Santiago Rivera <danysantiago@google.com>
Date: Tue Feb 13 20:20:41 2024
Remove @JvmStatic from DAO impls in Kotlin Codegen
Removed the generation of @JvmStatic in getRequiredConverters() due to 'Declaration annotated with '@OptionalExpectation' can only be used in common module sources'.
Bug: 299168035
Bug: 309995360
Test: DaoKotlinCodeGenTest
Change-Id: Ie56b35e73c4d74289fa9ade984cc41a0b3908f20
M room/room-compiler/src/main/kotlin/androidx/room/writer/DaoWriter.kt
M room/room-compiler/src/test/test-data/kotlinCodeGen/abstractClassWithParam.kt
M room/room-compiler/src/test/test-data/kotlinCodeGen/arrayParameterAdapter.kt
M room/room-compiler/src/test/test-data/kotlinCodeGen/basicParameterAdapter_string.kt
M room/room-compiler/src/test/test-data/kotlinCodeGen/callableQuery_rx2.kt
M room/room-compiler/src/test/test-data/kotlinCodeGen/callableQuery_rx3.kt
M room/room-compiler/src/test/test-data/kotlinCodeGen/collectionParameterAdapter_string.kt
M room/room-compiler/src/test/test-data/kotlinCodeGen/coroutineResultBinder.kt
M room/room-compiler/src/test/test-data/kotlinCodeGen/coroutines.kt
M room/room-compiler/src/test/test-data/kotlinCodeGen/delegatingFunctions_boxedPrimitiveBridge.kt
M room/room-compiler/src/test/test-data/kotlinCodeGen/delegatingFunctions_defaultImplBridge.kt
M room/room-compiler/src/test/test-data/kotlinCodeGen/deleteOrUpdateMethodAdapter.kt
M room/room-compiler/src/test/test-data/kotlinCodeGen/entityRowAdapter.kt
M room/room-compiler/src/test/test-data/kotlinCodeGen/guavaCallable.kt
M room/room-compiler/src/test/test-data/kotlinCodeGen/insertOrUpsertMethodAdapter.kt
M room/room-compiler/src/test/test-data/kotlinCodeGen/liveDataCallable.kt
M room/room-compiler/src/test/test-data/kotlinCodeGen/multiTypedPagingSourceResultBinder.kt
M room/room-compiler/src/test/test-data/kotlinCodeGen/paging_dataSource.kt
M room/room-compiler/src/test/test-data/kotlinCodeGen/pojoRowAdapter_boolean.kt
M room/room-compiler/src/test/test-data/kotlinCodeGen/pojoRowAdapter_byteArray.kt
M room/room-compiler/src/test/test-data/kotlinCodeGen/pojoRowAdapter_customTypeConverter.kt
M room/room-compiler/src/test/test-data/kotlinCodeGen/pojoRowAdapter_customTypeConverter_composite.kt
M room/room-compiler/src/test/test-data/kotlinCodeGen/pojoRowAdapter_customTypeConverter_internalVisibility.kt
M room/room-compiler/src/test/test-data/kotlinCodeGen/pojoRowAdapter_customTypeConverter_nullAware.kt
M room/room-compiler/src/test/test-data/kotlinCodeGen/pojoRowAdapter_customTypeConverter_provided.kt
M room/room-compiler/src/test/test-data/kotlinCodeGen/pojoRowAdapter_embedded.kt
M room/room-compiler/src/test/test-data/kotlinCodeGen/pojoRowAdapter_enum.kt
M room/room-compiler/src/test/test-data/kotlinCodeGen/pojoRowAdapter_internalVisibility.kt
M room/room-compiler/src/test/test-data/kotlinCodeGen/pojoRowAdapter_otherModule.kt
M room/room-compiler/src/test/test-data/kotlinCodeGen/pojoRowAdapter_primitives.kt
M room/room-compiler/src/test/test-data/kotlinCodeGen/pojoRowAdapter_primitives_nullable.kt
M room/room-compiler/src/test/test-data/kotlinCodeGen/pojoRowAdapter_string.kt
M room/room-compiler/src/test/test-data/kotlinCodeGen/pojoRowAdapter_uuid.kt
M room/room-compiler/src/test/test-data/kotlinCodeGen/pojoRowAdapter_valueClassConverter.kt
M room/room-compiler/src/test/test-data/kotlinCodeGen/pojoRowAdapter_variableProperty.kt
M room/room-compiler/src/test/test-data/kotlinCodeGen/pojoRowAdapter_variableProperty_java.kt
M room/room-compiler/src/test/test-data/kotlinCodeGen/preparedCallableQuery_rx2.kt
M room/room-compiler/src/test/test-data/kotlinCodeGen/preparedCallableQuery_rx3.kt
M room/room-compiler/src/test/test-data/kotlinCodeGen/preparedQueryAdapter.kt
M room/room-compiler/src/test/test-data/kotlinCodeGen/queryResultAdapter_array.kt
M room/room-compiler/src/test/test-data/kotlinCodeGen/queryResultAdapter_guavaImmutableMap.kt
M room/room-compiler/src/test/test-data/kotlinCodeGen/queryResultAdapter_guavaImmutableMultimap.kt
M room/room-compiler/src/test/test-data/kotlinCodeGen/queryResultAdapter_guavaOptional.kt
M room/room-compiler/src/test/test-data/kotlinCodeGen/queryResultAdapter_immutable_list.kt
M room/room-compiler/src/test/test-data/kotlinCodeGen/queryResultAdapter_list.kt
M room/room-compiler/src/test/test-data/kotlinCodeGen/queryResultAdapter_map.kt
M room/room-compiler/src/test/test-data/kotlinCodeGen/queryResultAdapter_map_ambiguousIndexAdapter.kt
M room/room-compiler/src/test/test-data/kotlinCodeGen/queryResultAdapter_nestedMap.kt
M room/room-compiler/src/test/test-data/kotlinCodeGen/queryResultAdapter_nestedMap_ambiguousIndexAdapter.kt
M room/room-compiler/src/test/test-data/kotlinCodeGen/queryResultAdapter_optional.kt
M room/room-compiler/src/test/test-data/kotlinCodeGen/rawQuery.kt
M room/room-compiler/src/test/test-data/kotlinCodeGen/relations.kt
M room/room-compiler/src/test/test-data/kotlinCodeGen/relations_arrayMap.kt
M room/room-compiler/src/test/test-data/kotlinCodeGen/relations_byteBufferKey.kt
M room/room-compiler/src/test/test-data/kotlinCodeGen/relations_longSparseArray.kt
M room/room-compiler/src/test/test-data/kotlinCodeGen/relations_nullable.kt
M room/room-compiler/src/test/test-data/kotlinCodeGen/shortcutMethods_rx2.kt
M room/room-compiler/src/test/test-data/kotlinCodeGen/shortcutMethods_rx3.kt
M room/room-compiler/src/test/test-data/kotlinCodeGen/shortcutMethods_suspend.kt
M room/room-compiler/src/test/test-data/kotlinCodeGen/transactionMethodAdapter_abstractClass.kt
M room/room-compiler/src/test/test-data/kotlinCodeGen/transactionMethodAdapter_interface.kt
ap...@google.com <ap...@google.com> #18
Branch: androidx-main
commit ba7ba6336dc87b389dc2b206c29d2d8bb3337e36
Author: Daniel Santiago Rivera <danysantiago@google.com>
Date: Wed Feb 14 09:03:55 2024
Fix missing return in compatibility mode when performing suspending query in a transaction
This is not a behavioral error but would have otherwise caused queries to run twice if in a transaction already.
Bug: 299168035
Test: SuspendingQueryTest
Change-Id: Ice77c3f9e569cb762fb9db0dcb3a15a7c5d52cff
M room/room-runtime/src/androidMain/kotlin/androidx/room/util/DBUtil.android.kt
ap...@google.com <ap...@google.com> #19
Branch: androidx-main
commit c312eb7e74f10d4791d73899383981a366beaee7
Author: Daniel Santiago Rivera <danysantiago@google.com>
Date: Fri Jan 26 11:53:00 2024
Room multiplatform test setup.
Setup the Room multiplatform integration project that generates KMP code and executes a simple query test in various platforms along with the necessary changes to support the test:
* Add the JVM database builder along with the inMemoryDatabaseBuilder() in native to support the database creation in various platforms.
* Update konan dependency url based on the 'kotlin.native.disableCompilerDaemon' as that affects the working directory and paths. Compiling on the daemon had to be disabled due to KT-65761
Bug: 299168035
Bug: 309995360
Bug: 322518085
Test: SimpleQueryTest
Change-Id: Iaa0433d501e27f69a8ffd4fa67adc224ae7968e8
M buildSrc/private/src/main/kotlin/androidx/build/KonanPrebuiltsSetup.kt
M development/build_log_simplifier/messages.ignore
M room/integration-tests/multiplatformtestapp/build.gradle
A room/integration-tests/multiplatformtestapp/src/androidInstrumentedTest/kotlin/androidx/room/integration/multiplatformtestapp/test/SimpleQueryTest.kt
A room/integration-tests/multiplatformtestapp/src/commonTest/kotlin/androidx/room/integration/multiplatformtestapp/test/BaseSimpleQueryTest.kt
M room/integration-tests/multiplatformtestapp/src/commonTest/kotlin/androidx/room/integration/multiplatformtestapp/test/SampleDatabase.kt
A room/integration-tests/multiplatformtestapp/src/jvmTest/kotlin/androidx/room/integration/multiplatformtestapp/test/SimpleQueryTest.kt
A room/integration-tests/multiplatformtestapp/src/nativeTest/kotlin/androidx/room/integration/multiplatformtestapp/test/SimpleQueryTest.kt
M room/room-runtime/src/androidMain/kotlin/androidx/room/InvalidationTracker.android.kt
A room/room-runtime/src/jvmMain/kotlin/androidx/room/Room.jvm.kt
M room/room-runtime/src/nativeMain/kotlin/androidx/room/Room.native.kt
ap...@google.com <ap...@google.com> #20
Branch: androidx-main
commit e006f4611b36d4798b35d07c904bf5f8626b2a04
Author: Daniel Santiago Rivera <danysantiago@google.com>
Date: Tue Feb 20 16:09:43 2024
Use raw connection in Room code gen utility functions
Update utility functions for code generation to take a lambda function that receives the raw SQLiteConnection. Such change makes it easier to generate code for both Java and Kotlin without having to deal with the connection pool coroutine APIs. Those APIs will still be expose to the user for correctness but internally Room will use the connection more directly. Using a raw connection reduces the number of utility functions created, which are effectively public APIs.
Bug: 299168035
Bug: 322167799
Test: Existing
Change-Id: I155b80a5d5e3da4df6fd3566dcbe34a0bf463472
M room/room-compiler/src/main/kotlin/androidx/room/solver/query/result/CoroutineResultBinder.kt
M room/room-compiler/src/main/kotlin/androidx/room/solver/query/result/InstantQueryResultBinder.kt
M room/room-compiler/src/test/test-data/daoWriter/output/javac/ComplexDao.java
M room/room-compiler/src/test/test-data/daoWriter/output/ksp/ComplexDao.java
M room/room-compiler/src/test/test-data/kotlinCodeGen/abstractClassWithParam.kt
M room/room-compiler/src/test/test-data/kotlinCodeGen/arrayParameterAdapter.kt
M room/room-compiler/src/test/test-data/kotlinCodeGen/basicParameterAdapter_string.kt
M room/room-compiler/src/test/test-data/kotlinCodeGen/collectionParameterAdapter_string.kt
M room/room-compiler/src/test/test-data/kotlinCodeGen/coroutineResultBinder.kt
M room/room-compiler/src/test/test-data/kotlinCodeGen/delegatingFunctions_boxedPrimitiveBridge.kt
M room/room-compiler/src/test/test-data/kotlinCodeGen/delegatingFunctions_defaultImplBridge.kt
M room/room-compiler/src/test/test-data/kotlinCodeGen/pojoRowAdapter_boolean.kt
M room/room-compiler/src/test/test-data/kotlinCodeGen/pojoRowAdapter_byteArray.kt
M room/room-compiler/src/test/test-data/kotlinCodeGen/pojoRowAdapter_customTypeConverter.kt
M room/room-compiler/src/test/test-data/kotlinCodeGen/pojoRowAdapter_customTypeConverter_composite.kt
M room/room-compiler/src/test/test-data/kotlinCodeGen/pojoRowAdapter_customTypeConverter_internalVisibility.kt
M room/room-compiler/src/test/test-data/kotlinCodeGen/pojoRowAdapter_customTypeConverter_nullAware.kt
M room/room-compiler/src/test/test-data/kotlinCodeGen/pojoRowAdapter_customTypeConverter_provided.kt
M room/room-compiler/src/test/test-data/kotlinCodeGen/pojoRowAdapter_embedded.kt
M room/room-compiler/src/test/test-data/kotlinCodeGen/pojoRowAdapter_enum.kt
M room/room-compiler/src/test/test-data/kotlinCodeGen/pojoRowAdapter_internalVisibility.kt
M room/room-compiler/src/test/test-data/kotlinCodeGen/pojoRowAdapter_otherModule.kt
M room/room-compiler/src/test/test-data/kotlinCodeGen/pojoRowAdapter_primitives.kt
M room/room-compiler/src/test/test-data/kotlinCodeGen/pojoRowAdapter_primitives_nullable.kt
M room/room-compiler/src/test/test-data/kotlinCodeGen/pojoRowAdapter_string.kt
M room/room-compiler/src/test/test-data/kotlinCodeGen/pojoRowAdapter_uuid.kt
M room/room-compiler/src/test/test-data/kotlinCodeGen/pojoRowAdapter_valueClassConverter.kt
M room/room-compiler/src/test/test-data/kotlinCodeGen/pojoRowAdapter_variableProperty.kt
M room/room-compiler/src/test/test-data/kotlinCodeGen/pojoRowAdapter_variableProperty_java.kt
M room/room-runtime/api/restricted_current.txt
M room/room-runtime/src/androidMain/kotlin/androidx/room/RoomAndroidConnectionManager.android.kt
M room/room-runtime/src/androidMain/kotlin/androidx/room/RoomDatabase.android.kt
M room/room-runtime/src/androidMain/kotlin/androidx/room/util/DBUtil.android.kt
M room/room-runtime/src/commonMain/kotlin/androidx/room/RoomDatabase.kt
M room/room-runtime/src/commonMain/kotlin/androidx/room/coroutines/ConnectionPool.kt
M room/room-runtime/src/commonMain/kotlin/androidx/room/coroutines/ConnectionPoolImpl.kt
M room/room-runtime/src/commonMain/kotlin/androidx/room/util/DBUtil.kt
M room/room-runtime/src/jvmMain/kotlin/androidx/room/RoomDatabase.jvm.kt
M room/room-runtime/src/jvmMain/kotlin/androidx/room/util/DBUtil.jvm.kt
M room/room-runtime/src/nativeMain/kotlin/androidx/room/RoomDatabase.native.kt
M room/room-runtime/src/nativeMain/kotlin/androidx/room/util/DBUtil.native.kt
ap...@google.com <ap...@google.com> #21
Branch: androidx-main
commit 602e6efe54b9d206ca6b0fcfac09d539d3b4c40e
Author: Daniel Santiago Rivera <danysantiago@google.com>
Date: Fri Feb 16 21:30:23 2024
Commonize Room's StringUtil
Also use kotlin.text.StringBuilder when generating Kotlin, and java.lang.StringBuilder when generating Java.
Bug: 299168035
Test: DaoKotlinCodeGenTest
Relnote: "Deprecate APIs in StringUtil no longer used by generated code."
Change-Id: Id2086115b79cd6b68632b26cfb7f4a3252b1514e
M room/room-compiler/src/main/kotlin/androidx/room/ext/xpoet_ext.kt
M room/room-compiler/src/main/kotlin/androidx/room/writer/QueryWriter.kt
M room/room-compiler/src/test/kotlin/androidx/room/solver/query/QueryWriterTest.kt
M room/room-compiler/src/test/test-data/daoWriter/output/javac/ComplexDao.java
M room/room-compiler/src/test/test-data/daoWriter/output/javac/DeletionDao.java
M room/room-compiler/src/test/test-data/daoWriter/output/ksp/ComplexDao.java
M room/room-compiler/src/test/test-data/daoWriter/output/ksp/DeletionDao.java
M room/room-compiler/src/test/test-data/kotlinCodeGen/arrayParameterAdapter.kt
M room/room-compiler/src/test/test-data/kotlinCodeGen/callableQuery_rx2.kt
M room/room-compiler/src/test/test-data/kotlinCodeGen/callableQuery_rx3.kt
M room/room-compiler/src/test/test-data/kotlinCodeGen/collectionParameterAdapter_string.kt
M room/room-compiler/src/test/test-data/kotlinCodeGen/coroutines.kt
M room/room-compiler/src/test/test-data/kotlinCodeGen/guavaCallable.kt
M room/room-compiler/src/test/test-data/kotlinCodeGen/liveDataCallable.kt
M room/room-compiler/src/test/test-data/kotlinCodeGen/relations.kt
M room/room-compiler/src/test/test-data/kotlinCodeGen/relations_arrayMap.kt
M room/room-compiler/src/test/test-data/kotlinCodeGen/relations_byteBufferKey.kt
M room/room-compiler/src/test/test-data/kotlinCodeGen/relations_longSparseArray.kt
M room/room-compiler/src/test/test-data/kotlinCodeGen/relations_nullable.kt
M room/room-runtime/api/restricted_current.txt
M room/room-runtime/src/commonMain/kotlin/androidx/room/util/StringUtil.kt
ap...@google.com <ap...@google.com> #22
Branch: androidx-main
commit aeb25e6b2e09dabbff92566dda08d6482b804b5f
Author: Daniel Santiago Rivera <danysantiago@google.com>
Date: Thu Feb 15 11:12:44 2024
Partially migrate PreparedQueryResultBinder to driver API
Specifically InstantPreparedQueryResultBinder, the new CoroutinePreparedQueryResultBinder and the PreparedQueryResultAdapter. This allows for codegen of KMP code for @Query DAO functions with INSERT, UPDATE and DELETE.
One important change is that prepared queries are no longer 'shared' and are prepared, bound and executed on-demand. The effects of this is not measured but should be minimal as Android's cache is deep in the SQLiteSession and not in its statements, meaning holding a reference to an Android statements actually means re-using the binding parameters, but the actual native statement may or may not hit the cache. Statement caching in SQLite KMP (driver APIs) is something to be addressed in the future (
Bug: 299168035
Test: Existing + BaseSimpleQueryTest
Change-Id: Ie5beb8591bbb16fd15fb1e0030281edb8909d892
M room/integration-tests/multiplatformtestapp/src/commonTest/kotlin/androidx/room/integration/multiplatformtestapp/test/BaseSimpleQueryTest.kt
M room/integration-tests/multiplatformtestapp/src/commonTest/kotlin/androidx/room/integration/multiplatformtestapp/test/SampleDatabase.kt
M room/room-compiler/src/main/kotlin/androidx/room/ext/xpoet_ext.kt
M room/room-compiler/src/main/kotlin/androidx/room/processor/MethodProcessorDelegate.kt
A room/room-compiler/src/main/kotlin/androidx/room/solver/prepared/binder/CoroutinePreparedQueryResultBinder.kt
M room/room-compiler/src/main/kotlin/androidx/room/solver/prepared/binder/InstantPreparedQueryResultBinder.kt
M room/room-compiler/src/main/kotlin/androidx/room/solver/prepared/binder/PreparedQueryResultBinder.kt
M room/room-compiler/src/main/kotlin/androidx/room/solver/prepared/result/PreparedQueryResultAdapter.kt
M room/room-compiler/src/main/kotlin/androidx/room/writer/DaoWriter.kt
M room/room-compiler/src/test/kotlin/androidx/room/writer/DaoKotlinCodeGenTest.kt
M room/room-compiler/src/test/test-data/daoWriter/output/javac/DeletionDao.java
M room/room-compiler/src/test/test-data/daoWriter/output/javac/UpdateDao.java
M room/room-compiler/src/test/test-data/daoWriter/output/ksp/DeletionDao.java
M room/room-compiler/src/test/test-data/daoWriter/output/ksp/UpdateDao.java
M room/room-compiler/src/test/test-data/kotlinCodeGen/coroutines.kt
M room/room-compiler/src/test/test-data/kotlinCodeGen/delegatingFunctions_boxedPrimitiveBridge.kt
M room/room-compiler/src/test/test-data/kotlinCodeGen/preparedCallableQuery_rx2.kt
M room/room-compiler/src/test/test-data/kotlinCodeGen/preparedCallableQuery_rx3.kt
M room/room-compiler/src/test/test-data/kotlinCodeGen/preparedQueryAdapter.kt
M room/room-runtime/api/restricted_current.txt
M room/room-runtime/src/androidMain/kotlin/androidx/room/util/DBUtil.android.kt
A room/room-runtime/src/commonMain/kotlin/androidx/room/util/ConnectionUtil.kt
M room/room-runtime/src/commonMain/kotlin/androidx/room/util/DBUtil.kt
M room/room-runtime/src/commonTest/kotlin/androidx/room/coroutines/BaseConnectionPoolTest.kt
ap...@google.com <ap...@google.com> #23
Branch: androidx-main
commit b3ec4798e04d7304e571745087fb4e6cb3270dba
Author: Daniel Santiago Rivera <danysantiago@google.com>
Date: Mon Feb 26 15:28:29 2024
Use Kotlin exceptions when generating Kotlin code.
This is required to generate KMP compatible code, with enums.
Bug: 299168035
Test: Existing
Change-Id: Ib4107df36390d846159aab2ad2355a156ffc9be9
M room/room-compiler/src/main/kotlin/androidx/room/ext/xpoet_ext.kt
M room/room-compiler/src/main/kotlin/androidx/room/solver/types/EnumColumnTypeAdapter.kt
M room/room-compiler/src/main/kotlin/androidx/room/solver/types/NullAwareTypeConverters.kt
M room/room-compiler/src/test/test-data/kotlinCodeGen/pojoRowAdapter_enum.kt
ap...@google.com <ap...@google.com> #24
Branch: androidx-main
commit d6bba8a587e18b358f95ba51dcffd7e04a64f302
Author: Daniel Santiago Rivera <danysantiago@google.com>
Date: Sat Feb 24 16:13:50 2024
Migrate ListQueryResultAdapter to driver API
Note that there is no getCount() API equivalent in SQLite KMP and thus lists will no longer be instantiated with an initial capacity.
Bug: 299168035
Test: BaseSimpleQueryTest + Existing
Change-Id: Ie1b028d1ef3e30535ee75457a1bea4146163d4bf
M room/integration-tests/multiplatformtestapp/src/commonTest/kotlin/androidx/room/integration/multiplatformtestapp/test/BaseSimpleQueryTest.kt
M room/integration-tests/multiplatformtestapp/src/commonTest/kotlin/androidx/room/integration/multiplatformtestapp/test/SampleDatabase.kt
M room/integration-tests/testapp/src/androidTest/java/androidx/room/integration/testapp/test/QueryTransactionTest.java
M room/room-compiler/src/main/kotlin/androidx/room/solver/query/result/ListQueryResultAdapter.kt
M room/room-compiler/src/test/test-data/daoWriter/output/javac/ComplexDao.java
M room/room-compiler/src/test/test-data/daoWriter/output/ksp/ComplexDao.java
M room/room-compiler/src/test/test-data/kotlinCodeGen/coroutines.kt
M room/room-compiler/src/test/test-data/kotlinCodeGen/multiTypedPagingSourceResultBinder.kt
M room/room-compiler/src/test/test-data/kotlinCodeGen/paging_dataSource.kt
M room/room-compiler/src/test/test-data/kotlinCodeGen/queryResultAdapter_list.kt
ap...@google.com <ap...@google.com> #25
Branch: androidx-main
commit c52a16c3c80c310f5a217cf265f358be2fd04b69
Author: Daniel Santiago Rivera <danysantiago@google.com>
Date: Mon Feb 26 10:18:12 2024
Commonize RoomDatabase.Callback
For Android this CL adds driver API mirror callbacks.
Bug: 299168035
Bug: 316944352
Test: BaseBuilderTest + Existing
Relnote: "Add RoomDatabase.Callback mirror functions that receive a connection from the driver API."
Change-Id: If313197a87a327146133f49d422958852c12ca49
A room/integration-tests/multiplatformtestapp/src/androidInstrumentedTest/kotlin/androidx/room/integration/multiplatformtestapp/test/BuilderTest.kt
A room/integration-tests/multiplatformtestapp/src/commonTest/kotlin/androidx/room/integration/multiplatformtestapp/test/BaseBuilderTest.kt
A room/integration-tests/multiplatformtestapp/src/jvmTest/kotlin/androidx/room/integration/multiplatformtestapp/test/BuilderTest.kt
A room/integration-tests/multiplatformtestapp/src/nativeTest/kotlin/androidx/room/integration/multiplatformtestapp/test/BuilderTest.kt
M room/room-runtime/api/current.txt
M room/room-runtime/api/restricted_current.txt
M room/room-runtime/src/androidMain/kotlin/androidx/room/DatabaseConfiguration.android.kt
M room/room-runtime/src/androidMain/kotlin/androidx/room/RoomAndroidConnectionManager.android.kt
M room/room-runtime/src/androidMain/kotlin/androidx/room/RoomDatabase.android.kt
M room/room-runtime/src/commonMain/kotlin/androidx/room/DatabaseConfiguration.kt
M room/room-runtime/src/commonMain/kotlin/androidx/room/RoomConnectionManager.kt
M room/room-runtime/src/commonMain/kotlin/androidx/room/RoomDatabase.kt
M room/room-runtime/src/jvmMain/kotlin/androidx/room/DatabaseConfiguration.jvm.kt
M room/room-runtime/src/jvmMain/kotlin/androidx/room/RoomDatabase.jvm.kt
M room/room-runtime/src/jvmMain/kotlin/androidx/room/RoomJvmConnectionManager.jvm.kt
M room/room-runtime/src/nativeMain/kotlin/androidx/room/DatabaseConfiguration.native.kt
M room/room-runtime/src/nativeMain/kotlin/androidx/room/RoomDatabase.native.kt
M room/room-runtime/src/nativeMain/kotlin/androidx/room/RoomNativeConnectionManager.native.kt
ap...@google.com <ap...@google.com> #26
Branch: androidx-main
commit 8927140309cae649e27814cfc81c4a42e69d7a07
Author: Daniel Santiago Rivera <danysantiago@google.com>
Date: Tue Feb 27 15:12:53 2024
Migrate Transaction binder and adapter to driver API.
To support coroutine transaction delegate in Java and Kotlin a new utility function was created in DBUtil that takes a suspend lambda, required when invoking the delegate super suspend function. Usage of Java 8 lambda was already present due to
Bug: 299168035
Test: BuilderTest + BundledSQLiteConnectionPoolTest
Change-Id: I60739bfa06d46571db5bf2ac5bdb1fd390ff8ee1
M room/integration-tests/multiplatformtestapp/src/commonTest/kotlin/androidx/room/integration/multiplatformtestapp/test/BaseSimpleQueryTest.kt
M room/integration-tests/multiplatformtestapp/src/commonTest/kotlin/androidx/room/integration/multiplatformtestapp/test/SampleDatabase.kt
M room/room-compiler/src/main/kotlin/androidx/room/processor/MethodProcessorDelegate.kt
M room/room-compiler/src/main/kotlin/androidx/room/solver/transaction/binder/CoroutineTransactionMethodBinder.kt
M room/room-compiler/src/main/kotlin/androidx/room/solver/transaction/binder/InstantTransactionMethodBinder.kt
M room/room-compiler/src/main/kotlin/androidx/room/solver/transaction/binder/TransactionMethodBinder.kt
M room/room-compiler/src/main/kotlin/androidx/room/solver/transaction/result/TransactionMethodAdapter.kt
M room/room-compiler/src/main/kotlin/androidx/room/writer/DaoWriter.kt
M room/room-compiler/src/test/test-data/daoWriter/output/javac/ComplexDao.java
M room/room-compiler/src/test/test-data/daoWriter/output/javac/UpdateDao.java
M room/room-compiler/src/test/test-data/daoWriter/output/ksp/ComplexDao.java
M room/room-compiler/src/test/test-data/daoWriter/output/ksp/UpdateDao.java
M room/room-compiler/src/test/test-data/kotlinCodeGen/transactionMethodAdapter_abstractClass.kt
M room/room-compiler/src/test/test-data/kotlinCodeGen/transactionMethodAdapter_interface.kt
M room/room-runtime/api/restricted_current.txt
M room/room-runtime/src/androidMain/kotlin/androidx/room/RoomDatabase.android.kt
M room/room-runtime/src/androidMain/kotlin/androidx/room/util/DBUtil.android.kt
M room/room-runtime/src/commonMain/kotlin/androidx/room/util/DBUtil.kt
M room/room-runtime/src/jvmMain/kotlin/androidx/room/util/DBUtil.jvm.kt
M room/room-runtime/src/nativeMain/kotlin/androidx/room/util/DBUtil.native.kt
ap...@google.com <ap...@google.com> #27
Branch: androidx-main
commit 2d7cd8d2356e0d95c4ae6ed933eaf45351749d09
Author: Daniel Santiago Rivera <danysantiago@google.com>
Date: Tue Mar 05 21:10:50 2024
Store instance of SupportPooledConnection in support pool
A small optimization to avoid creating a new SupportPooledConnection on every useConnection call.
Bug: 299168035
Test: Existing
Change-Id: Ibdb364040ef467d8a739b8d27ec8cefc69a5353d
M room/room-runtime/src/androidMain/kotlin/androidx/room/RoomAndroidConnectionManager.android.kt
ap...@google.com <ap...@google.com> #28
Branch: androidx-main
commit 93665c676e656f2a0359523adcad8b5e9e2bd41d
Author: elifbilgin <elifbilgin@google.com>
Date: Wed Mar 06 11:30:57 2024
Upgrade Room Gradle Plugin the latest version that is a HEAD.
Also updates the KMP test app to use the plugin.
Bug: 299168035
Test: Existing tests
Change-Id: Ib265171d9ce66d36682bb8f07738520f1521f8eb
A buildSrc/imports/room-gradle-plugin/build.gradle
M buildSrc/plugins/build.gradle
M buildSrc/settings.gradle
M buildSrc/shared-dependencies.gradle
M gradle/libs.versions.toml
M room/integration-tests/multiplatformtestapp/build.gradle
M room/room-gradle-plugin/src/main/java/androidx/room/gradle/RoomArgumentProvider.kt
M room/room-gradle-plugin/src/main/java/androidx/room/gradle/RoomExtension.kt
M room/room-gradle-plugin/src/main/java/androidx/room/gradle/integration/AndroidPluginIntegration.kt
ap...@google.com <ap...@google.com> #29
Branch: androidx-main
commit 87105e8e6c5275a438182230516a13f16a26da63
Author: elifbilgin <elifbilgin@google.com>
Date: Wed Mar 06 11:32:11 2024
Migrate AutoMigrationWriter logic to use drivers.
This CL also updates the multiplatform test app has been
to use the Room Gradle Plugin for schema access during auto migration testing.
Bug: 299168035
Test: BaseAutoMigrationTest.kt
Relnote: Migrate AutoMigrationWriter logic to use drivers.
Change-Id: Ib6218c1cf2fac60b609906fac67d85c3f23c37aa
M room/integration-tests/kotlintestapp/src/androidTest/java/androidx/room/integration/kotlintestapp/migration/AutoMigrationTest.kt
M room/integration-tests/kotlintestapp/src/androidTest/java/androidx/room/integration/kotlintestapp/migration/MigrationKotlinTest.kt
A room/integration-tests/multiplatformtestapp/schemas-ksp/androidx.room.integration.multiplatformtestapp.test.BaseAutoMigrationTest.AutoMigrationDatabase/1.json
A room/integration-tests/multiplatformtestapp/schemas-ksp/androidx.room.integration.multiplatformtestapp.test.BaseAutoMigrationTest.AutoMigrationDatabase/2.json
A room/integration-tests/multiplatformtestapp/src/androidInstrumentedTest/kotlin/androidx/room/integration/multiplatformtestapp/test/AutoMigrationTest.kt
A room/integration-tests/multiplatformtestapp/src/commonTest/kotlin/androidx/room/integration/multiplatformtestapp/test/BaseAutoMigrationTest.kt
A room/integration-tests/multiplatformtestapp/src/jvmTest/kotlin/androidx/room/integration/multiplatformtestapp/test/AutoMigrationTest.kt
A room/integration-tests/multiplatformtestapp/src/nativeTest/kotlin/androidx/room/integration/multiplatformtestapp/test/AutoMigrationTest.kt
M room/integration-tests/testapp/src/androidTest/java/androidx/room/integration/testapp/migration/AutoMigrationTest.java
M room/room-compiler/src/main/kotlin/androidx/room/processor/AutoMigrationProcessor.kt
M room/room-compiler/src/main/kotlin/androidx/room/processor/DatabaseProcessor.kt
M room/room-compiler/src/main/kotlin/androidx/room/writer/AutoMigrationWriter.kt
M room/room-compiler/src/test/kotlin/androidx/room/writer/AutoMigrationWriterTest.kt
M room/room-compiler/src/test/test-data/autoMigrationWriter/output/java/AutoMigrationWithProvidedSpec.java
M room/room-compiler/src/test/test-data/autoMigrationWriter/output/java/ValidAutoMigrationWithDefault.java
M room/room-compiler/src/test/test-data/autoMigrationWriter/output/java/ValidAutoMigrationWithoutDefault.java
M room/room-compiler/src/test/test-data/autoMigrationWriter/output/kotlin/AutoMigrationWithProvidedSpec.kt
M room/room-compiler/src/test/test-data/autoMigrationWriter/output/kotlin/ValidAutoMigrationWithDefault.kt
M room/room-compiler/src/test/test-data/autoMigrationWriter/output/kotlin/ValidAutoMigrationWithoutDefault.kt
M room/room-runtime/api/current.txt
M room/room-runtime/api/restricted_current.txt
M room/room-runtime/src/androidMain/kotlin/androidx/room/RoomOpenHelper.android.kt
M room/room-runtime/src/androidMain/kotlin/androidx/room/migration/AutoMigrationSpec.android.kt
M room/room-runtime/src/androidMain/kotlin/androidx/room/migration/Migration.android.kt
M room/room-runtime/src/androidMain/kotlin/androidx/room/util/DBUtil.android.kt
M room/room-runtime/src/commonMain/kotlin/androidx/room/migration/Migration.kt
M room/room-runtime/src/commonMain/kotlin/androidx/room/util/DBUtil.kt
ap...@google.com <ap...@google.com> #30
Branch: androidx-main
commit 40764227cd4ce47e994bec0cad91071e1870c59c
Author: Daniel Santiago Rivera <danysantiago@google.com>
Date: Thu Mar 07 08:46:59 2024
Make room-migration a KMP project
Bug: 299168035
Test: ./gradlew :room:room-migration:allTests
Change-Id: Ibbd6545f1348f6049ee9a83c0b5af413c1f2888a
M docs-tip-of-tree/build.gradle
M room/room-migration/build.gradle
A room/room-migration/src/commonMain/kotlin/androidx/room/migration/bundle/Placeholder.kt
M room/room-migration/src/jvmMain/kotlin/androidx/room/migration/bundle/BundleUtil.jvm.kt
M room/room-migration/src/jvmMain/kotlin/androidx/room/migration/bundle/DatabaseBundle.jvm.kt
M room/room-migration/src/jvmMain/kotlin/androidx/room/migration/bundle/DatabaseViewBundle.jvm.kt
M room/room-migration/src/jvmMain/kotlin/androidx/room/migration/bundle/EntityBundle.jvm.kt
M room/room-migration/src/jvmMain/kotlin/androidx/room/migration/bundle/FieldBundle.jvm.kt
M room/room-migration/src/jvmMain/kotlin/androidx/room/migration/bundle/ForeignKeyBundle.jvm.kt
M room/room-migration/src/jvmMain/kotlin/androidx/room/migration/bundle/FtsEntityBundle.jvm.kt
M room/room-migration/src/jvmMain/kotlin/androidx/room/migration/bundle/FtsOptionsBundle.jvm.kt
M room/room-migration/src/jvmMain/kotlin/androidx/room/migration/bundle/IndexBundle.jvm.kt
M room/room-migration/src/jvmMain/kotlin/androidx/room/migration/bundle/PrimaryKeyBundle.jvm.kt
M room/room-migration/src/jvmMain/kotlin/androidx/room/migration/bundle/SchemaBundle.jvm.kt
M room/room-migration/src/jvmMain/kotlin/androidx/room/migration/bundle/SchemaEquality.jvm.kt
M room/room-migration/src/jvmMain/kotlin/androidx/room/migration/bundle/SchemaEqualityUtil.jvm.kt
M room/room-migration/src/jvmTest/kotlin/androidx/room/migration/bundle/DatabaseBundleTest.kt
M room/room-migration/src/jvmTest/kotlin/androidx/room/migration/bundle/DatabaseViewBundleTest.kt
M room/room-migration/src/jvmTest/kotlin/androidx/room/migration/bundle/EntityBundleTest.kt
M room/room-migration/src/jvmTest/kotlin/androidx/room/migration/bundle/FieldBundleTest.kt
M room/room-migration/src/jvmTest/kotlin/androidx/room/migration/bundle/ForeignKeyBundleTest.kt
M room/room-migration/src/jvmTest/kotlin/androidx/room/migration/bundle/IndexBundleTest.kt
M room/room-migration/src/jvmTest/kotlin/androidx/room/migration/bundle/PrimaryKeyBundleTest.kt
M settings.gradle
ap...@google.com <ap...@google.com> #31
Branch: androidx-main
commit a997a22575b662e5c64ddd25a32fae2e870a098d
Author: Daniel Santiago Rivera <danysantiago@google.com>
Date: Thu Mar 07 09:12:51 2024
Make room-testing a KMP project
Also removed the single AutoMigration test in the project as that is already covered by multiple other tests in the integration test projects. By removing the test we avoid applying KSP to the project and thus saving a bit of build time. Infra will be happy... :)
Bug: 299168035
Test: ./gradlew :room:room-testing:build
Change-Id: I953908b1227b83df859a2c305ecc7e5481b558ae
M docs-tip-of-tree/build.gradle
M room/room-testing/build.gradle
D room/room-testing/schemas/androidx.room.testing.kotlintestapp.migration.SimpleAutoMigrationDb/1.json
D room/room-testing/schemas/androidx.room.testing.kotlintestapp.migration.SimpleAutoMigrationDb/2.json
M room/room-testing/src/androidMain/kotlin/androidx/room/testing/BundleUtil.android.kt
M room/room-testing/src/androidMain/kotlin/androidx/room/testing/MigrationTestHelper.android.kt
D room/room-testing/src/androidTest/java/androidx/room/testing/kotlintestapp/migration/AutoMigrationAndMigrationTest.kt
D room/room-testing/src/androidTest/java/androidx/room/testing/kotlintestapp/migration/SimpleAutoMigrationDb.kt
A room/room-testing/src/commonMain/kotlin/androidx/room/testing/Placeholder.kt
D room/room-testing/src/main/AndroidManifest.xml
M settings.gradle
ap...@google.com <ap...@google.com> #32
Branch: androidx-main
commit 4a463c08b68e8afa90ef6f8147e45c4f129b3ae1
Author: elifbilgin <elifbilgin@google.com>
Date: Thu Mar 07 17:11:35 2024
Move MapQueryResultAdapter to driver API.
Moves the regular Map type support to the driver APIs.
Bug: 299168035
Test: BaseSimpleQueryTest.kt
Relnote: Move MapQueryResultAdapter to driver API.
Change-Id: Iac8e08bdf977284ae6682fc91aba76aab5e9efa8
M room/integration-tests/multiplatformtestapp/src/commonTest/kotlin/androidx/room/integration/multiplatformtestapp/test/BaseSimpleQueryTest.kt
M room/integration-tests/multiplatformtestapp/src/commonTest/kotlin/androidx/room/integration/multiplatformtestapp/test/SampleDatabase.kt
M room/room-compiler/src/main/kotlin/androidx/room/ext/xpoet_ext.kt
M room/room-compiler/src/main/kotlin/androidx/room/solver/query/result/AmbiguousColumnIndexAdapter.kt
M room/room-compiler/src/main/kotlin/androidx/room/solver/query/result/MapQueryResultAdapter.kt
M room/room-compiler/src/main/kotlin/androidx/room/solver/query/result/MapValueResultAdapter.kt
M room/room-compiler/src/main/kotlin/androidx/room/solver/query/result/MultimapQueryResultAdapter.kt
M room/room-compiler/src/main/kotlin/androidx/room/solver/query/result/PojoRowAdapter.kt
M room/room-compiler/src/main/kotlin/androidx/room/solver/query/result/SingleNamedColumnRowAdapter.kt
M room/room-compiler/src/test/test-data/kotlinCodeGen/queryResultAdapter_guavaImmutableMap.kt
M room/room-compiler/src/test/test-data/kotlinCodeGen/queryResultAdapter_map.kt
M room/room-compiler/src/test/test-data/kotlinCodeGen/queryResultAdapter_map_ambiguousIndexAdapter.kt
M room/room-compiler/src/test/test-data/kotlinCodeGen/queryResultAdapter_nestedMap.kt
M room/room-compiler/src/test/test-data/kotlinCodeGen/queryResultAdapter_nestedMap_ambiguousIndexAdapter.kt
M room/room-runtime/api/restricted_current.txt
M room/room-runtime/src/commonMain/kotlin/androidx/room/util/StatementUtil.kt
ap...@google.com <ap...@google.com> #33
Branch: androidx-main
commit 29e2dfe64a05642696d983db2460225c69d6060c
Author: Daniel Santiago Rivera <danysantiago@google.com>
Date: Tue Mar 05 09:54:44 2024
Add a Coroutine context and scope to Room
As part of the migration to KMP and to coroutines internals, Room will now accept a CoroutineContext in the builder for any coroutine related tasks and queries, such as Flow emissions and in the future invalidation tracker refreshes. A RoomDatabase will only be allowed to be configured with either a coroutine context or executors, but not both.
Backwards compatibility of using the configured Executors in Android will remain, for native and JVM then if no context is provided Dispatchers.IO is used.
Bug: 299168035
Bug: 309996304
Test: Existing
Relnote: "Add a RoomDatabase.Builder setter for a CoroutineContext that will be used to perform Coroutine related queries."
Change-Id: Ib40071a42c18673bbaa2a2ed247919f9f258a2b7
M room/integration-tests/multiplatformtestapp/src/commonTest/kotlin/androidx/room/integration/multiplatformtestapp/test/BaseBuilderTest.kt
M room/room-paging/src/main/java/androidx/room/paging/LimitOffsetPagingSource.kt
M room/room-runtime/api/current.txt
M room/room-runtime/api/restricted_current.txt
M room/room-runtime/src/androidInstrumentedTest/kotlin/androidx/room/CoroutineRoomCancellationTest.kt
M room/room-runtime/src/androidMain/kotlin/androidx/room/CoroutinesRoom.android.kt
M room/room-runtime/src/androidMain/kotlin/androidx/room/DatabaseConfiguration.android.kt
M room/room-runtime/src/androidMain/kotlin/androidx/room/RoomDatabase.android.kt
M room/room-runtime/src/androidMain/kotlin/androidx/room/util/DBUtil.android.kt
M room/room-runtime/src/androidUnitTest/kotlin/androidx/room/BuilderTest.kt
D room/room-runtime/src/androidUnitTest/kotlin/androidx/room/CoroutinesRoomTest.kt
M room/room-runtime/src/commonMain/kotlin/androidx/room/DatabaseConfiguration.kt
M room/room-runtime/src/commonMain/kotlin/androidx/room/RoomDatabase.kt
M room/room-runtime/src/commonMain/kotlin/androidx/room/util/DBUtil.kt
M room/room-runtime/src/jvmNativeMain/kotlin/androidx/room/DatabaseConfiguration.jvmNative.kt
M room/room-runtime/src/jvmNativeMain/kotlin/androidx/room/RoomDatabase.jvmNative.kt
M room/room-runtime/src/jvmNativeMain/kotlin/androidx/room/util/DBUtil.jvmNative.kt
M room/room-testing/src/androidMain/kotlin/androidx/room/testing/MigrationTestHelper.android.kt
ap...@google.com <ap...@google.com> #34
Branch: androidx-main
commit 2a23e49a9c9b46eb95ae66a14c10a17fa1fa1ee0
Author: Daniel Santiago Rivera <danysantiago@google.com>
Date: Tue Mar 05 11:05:40 2024
Commonize Room's close lock
Replace RoomDatabase's read-write lock with an internal implementation that uses atomic primitives. The lock (now called a barrier) is used delay closing the database until the invalidation tracker is done performing async work.
Bug: 299168035
Bug: 309996304
Test: CloseLockTest + Existing
Change-Id: I3ba246fa11ae4950157e6f86027928e47af79b1e
M room/room-runtime/src/androidMain/kotlin/androidx/room/InvalidationTracker.android.kt
M room/room-runtime/src/androidMain/kotlin/androidx/room/RoomDatabase.android.kt
M room/room-runtime/src/androidUnitTest/kotlin/androidx/room/InvalidationTrackerTest.kt
M room/room-runtime/src/commonMain/kotlin/androidx/room/RoomDatabase.kt
A room/room-runtime/src/commonMain/kotlin/androidx/room/concurrent/CloseBarrier.kt
A room/room-runtime/src/commonTest/kotlin/androidx/room/concurrent/CloseBarrierTest.kt
M room/room-runtime/src/jvmNativeMain/kotlin/androidx/room/RoomDatabase.jvmNative.kt
ap...@google.com <ap...@google.com> #35
Branch: androidx-main
commit 5305f501aab1025df547b3b43fa1c19204a219bc
Author: Daniel Santiago Rivera <danysantiago@google.com>
Date: Tue Mar 05 12:59:21 2024
Commonize InvalidationTracker's table observability state
Move the helper class that tracks whether a table needs to be observed or not based on register Observer into common code.
Bug: 299168035
Bug: 309990302
Test: ObservedTableStates + Existing
Change-Id: I1d4622ead35cdb08693addfe2ef02cc711da7c71
M room/room-runtime/src/androidMain/kotlin/androidx/room/InvalidationTracker.android.kt
A room/room-runtime/src/androidUnitTest/kotlin/androidx/room/ObservedTableStatesTest.kt
D room/room-runtime/src/androidUnitTest/kotlin/androidx/room/ObservedTableTrackerTest.kt
M room/room-runtime/src/commonMain/kotlin/androidx/room/InvalidationTracker.kt
ap...@google.com <ap...@google.com> #36
Branch: androidx-main
commit 213765d55d5bea60e1a4ca40228f661ef300e49b
Author: Daniel Santiago Rivera <danysantiago@google.com>
Date: Tue Mar 05 13:25:31 2024
Commonize InvalidationTracker.Observer
Define the tracker's observer class in common and move the internal wrapper used for dispatching notifications to common source sets too.
Bug: 299168035
Bug: 309990302
Test: Existing
Change-Id: I7a95be774467c49d7a48ce9c56f467a2628fc211
M room/room-runtime/src/androidMain/kotlin/androidx/room/InvalidationTracker.android.kt
M room/room-runtime/src/commonMain/kotlin/androidx/room/InvalidationTracker.kt
M room/room-runtime/src/jvmNativeMain/kotlin/androidx/room/InvalidationTracker.jvmNative.kt
ap...@google.com <ap...@google.com> #37
Branch: androidx-main
commit 7058e53a8187fe9aa219ef6519eaad253a08cb46
Author: Daniel Santiago Rivera <danysantiago@google.com>
Date: Tue Mar 05 20:07:14 2024
Commonize InvalidationTracker
Move the bulk of the TRIGGER logic in Room's InvalidationTracker to an internal class in the common source set called TriggerBasedInvalidationTracker. The public APIs of InvalidationTracker will then delegate to the internal implementation allowing functionality to be shared across platforms.
Asynchronous related logic has been migrated to Coroutines using Room's new CoroutineScope and provided CoroutineContext.
Two new APIs are added to the common version of the tracker (and available to Android too), 'subscribe' and 'unsubscribe' suspend functions to add and remove observers from the tracker.
Bug: 299168035
Bug: 309990302
Bug: 309996304
Test: Existing++
Relnote: "Add suspend APIs for subscribing and unsubscribing InvalidationTracker.Observer with the RoomDatabase tracker."
Change-Id: If2a1f5b2442c6772b67afcae92996d1a8a9ff2ac
D room/integration-tests/kotlintestapp/src/androidTest/java/InvalidationTrackerExt.kt
M room/integration-tests/kotlintestapp/src/androidTest/java/androidx/room/integration/kotlintestapp/test/FlowQueryTest.kt
M room/integration-tests/kotlintestapp/src/androidTest/java/androidx/room/integration/kotlintestapp/test/MultiTypedPagingSourceTest.kt
A room/integration-tests/multiplatformtestapp/src/androidInstrumentedTest/kotlin/androidx/room/integration/multiplatformtestapp/test/InvalidationTest.kt
A room/integration-tests/multiplatformtestapp/src/commonTest/kotlin/androidx/room/integration/multiplatformtestapp/test/BaseInvalidationTest.kt
M room/integration-tests/multiplatformtestapp/src/commonTest/kotlin/androidx/room/integration/multiplatformtestapp/test/BaseSimpleQueryTest.kt
A room/integration-tests/multiplatformtestapp/src/jvmTest/kotlin/androidx/room/integration/multiplatformtestapp/test/InvalidationTest.kt
A room/integration-tests/multiplatformtestapp/src/nativeTest/kotlin/androidx/room/integration/multiplatformtestapp/test/InvalidationTest.kt
D room/integration-tests/testapp/src/androidTest/java/androidx/room/InvalidationTrackerTrojan.java
M room/integration-tests/testapp/src/androidTest/java/androidx/room/integration/testapp/test/AutoClosingRoomOpenHelperTest.java
M room/integration-tests/testapp/src/androidTest/java/androidx/room/integration/testapp/test/LiveDataQueryTest.java
M room/integration-tests/testapp/src/androidTest/java/androidx/room/integration/testapp/test/MultiInstanceInvalidationTest.java
M room/integration-tests/testapp/src/androidTest/java/androidx/room/integration/testapp/test/QueryTransactionTest.java
D room/room-paging/src/androidTest/kotlin/androidx/room/InvalidationTrackerExtRoomPaging.kt
M room/room-paging/src/androidTest/kotlin/androidx/room/paging/LimitOffsetPagingSourceTest.kt
M room/room-runtime/api/restricted_current.txt
M room/room-runtime/src/androidInstrumentedTest/kotlin/androidx/room/CoroutineRoomCancellationTest.kt
A room/room-runtime/src/androidInstrumentedTest/kotlin/androidx/room/support/AutoClosingDatabaseTest.kt
M room/room-runtime/src/androidMain/kotlin/androidx/room/InvalidationTracker.android.kt
M room/room-runtime/src/androidMain/kotlin/androidx/room/MultiInstanceInvalidationClient.android.kt
M room/room-runtime/src/androidMain/kotlin/androidx/room/RoomDatabase.android.kt
M room/room-runtime/src/androidMain/kotlin/androidx/room/util/DBUtil.android.kt
M room/room-runtime/src/androidUnitTest/kotlin/androidx/room/InvalidationTrackerTest.kt
M room/room-runtime/src/commonMain/kotlin/androidx/room/InvalidationTracker.kt
M room/room-runtime/src/commonMain/kotlin/androidx/room/util/DBUtil.kt
M room/room-runtime/src/jvmNativeMain/kotlin/androidx/room/InvalidationTracker.jvmNative.kt
M room/room-runtime/src/jvmNativeMain/kotlin/androidx/room/RoomDatabase.jvmNative.kt
M room/room-runtime/src/jvmNativeMain/kotlin/androidx/room/util/DBUtil.jvmNative.kt
ap...@google.com <ap...@google.com> #38
Branch: androidx-main
commit a9e24e67c4f6bea58b8e0356af00aa662743573b
Author: Daniel Santiago Rivera <danysantiago@google.com>
Date: Fri Mar 08 16:45:57 2024
Exchanging GSON for Kotlin Serialization JSON in room-migration
Refactor room-migration to use kotlinx-serialization-json instead of the GSON library. Both libraries have the necessary features for room-migration but Kotlin's is KMP compatible.
The main difference in the refactor is how polymorphic type EntityBundle is handled, specifically in kotlinx-serialization the properties of the parent class must be abstract or otherwise it is considered duplicate properties, this lead to the inheritance of FtsEntityBundle and EntityBundle to be refactored into implementations of a sealed class named BaseEntityBundle. To help with polymorphic types kotlinx-serialization uses a type classifier, but we configure encoding to not emit the classifier as that encodes internal class details and instead, similar to GSON we use a content inspector to decided which type to decode, specifically if the 'ftsVersion' key is present we decode the JSON object into a FtsEntityBundle otherwise it is decoded into an EntityBundle.
Kotlin serialization also supports optional (or missing) key-value pairs, this is important as there are certain entries that are not present in older generates schemas, such as IndexBundle's orders. These are handled by using a default value in the constructor parameter. Meanwhile 'transient' properties (those that are not encoded into the JSON) are also supported either via an annotation, or by having no backing field (such as delegate properties).
Lastly, room-migration is solely used by room-compiler and room-testing but due to historical reasons its APIs where marked as @RestrictTo with LIBRARY_GROUP_PREFIX but are in fact restricted to LIBRARY_GROUP only. No APIs in this project are ever used in generated code or other androidx libraries. This CL fixes this by removing updating the @RestrictTo which allows further modifications to the APIs to conform to Kotlin's serialization requirements and to cleanup GSON used constructors.
Note that the migration tests in Room's integration project contain an extensive set of schema files that have been generated by old versions of the compiler, the fact that these schemas are decoded and the tests pass are a testament of the correctness of this CL, thus the minimal change to tests. Similarly that no current schema files changed is a signal that schema equality if working as expected.
Bug: 299168035
Bug: 317908685
Test: Existing
Change-Id: I43a7f9b9672efc656628b52fe2012d2ef75e1a8f
M room/integration-tests/kotlintestapp/src/androidTest/java/androidx/room/integration/kotlintestapp/migration/AutoMigrationTest.kt
M room/integration-tests/testapp/src/androidTest/java/androidx/room/integration/testapp/migration/AutoMigrationTest.java
M room/integration-tests/testapp/src/androidTest/java/androidx/room/integration/testapp/migration/MigrationTest.java
M room/room-compiler/src/main/kotlin/androidx/room/processor/DatabaseProcessor.kt
M room/room-compiler/src/main/kotlin/androidx/room/processor/ProcessorErrors.kt
M room/room-compiler/src/main/kotlin/androidx/room/util/SchemaDiffer.kt
M room/room-compiler/src/main/kotlin/androidx/room/vo/AutoMigration.kt
M room/room-compiler/src/main/kotlin/androidx/room/vo/Database.kt
M room/room-compiler/src/main/kotlin/androidx/room/vo/Entity.kt
M room/room-compiler/src/main/kotlin/androidx/room/vo/FtsEntity.kt
M room/room-compiler/src/main/kotlin/androidx/room/writer/AutoMigrationWriter.kt
M room/room-compiler/src/test/kotlin/androidx/room/processor/DatabaseProcessorTest.kt
A room/room-migration/api/restricted_current.ignore
M room/room-migration/api/restricted_current.txt
M room/room-migration/build.gradle
A room/room-migration/src/commonMain/kotlin/androidx/room/migration/bundle/BaseEntityBundle.kt
M room/room-migration/src/commonMain/kotlin/androidx/room/migration/bundle/BundleUtil.kt
M room/room-migration/src/commonMain/kotlin/androidx/room/migration/bundle/DatabaseBundle.kt
M room/room-migration/src/commonMain/kotlin/androidx/room/migration/bundle/DatabaseViewBundle.kt
M room/room-migration/src/commonMain/kotlin/androidx/room/migration/bundle/EntityBundle.kt
M room/room-migration/src/commonMain/kotlin/androidx/room/migration/bundle/FieldBundle.kt
M room/room-migration/src/commonMain/kotlin/androidx/room/migration/bundle/ForeignKeyBundle.kt
M room/room-migration/src/commonMain/kotlin/androidx/room/migration/bundle/FtsEntityBundle.kt
M room/room-migration/src/commonMain/kotlin/androidx/room/migration/bundle/FtsOptionsBundle.kt
M room/room-migration/src/commonMain/kotlin/androidx/room/migration/bundle/IndexBundle.kt
M room/room-migration/src/commonMain/kotlin/androidx/room/migration/bundle/PrimaryKeyBundle.kt
M room/room-migration/src/commonMain/kotlin/androidx/room/migration/bundle/SchemaBundle.kt
M room/room-migration/src/commonMain/kotlin/androidx/room/migration/bundle/SchemaEquality.kt
M room/room-migration/src/commonMain/kotlin/androidx/room/migration/bundle/SchemaEqualityUtil.kt
M room/room-migration/src/commonTest/kotlin/androidx/room/migration/bundle/DatabaseBundleTest.kt
M room/room-migration/src/commonTest/kotlin/androidx/room/migration/bundle/DatabaseViewBundleTest.kt
M room/room-migration/src/commonTest/kotlin/androidx/room/migration/bundle/EntityBundleTest.kt
M room/room-migration/src/commonTest/kotlin/androidx/room/migration/bundle/FieldBundleTest.kt
M room/room-migration/src/commonTest/kotlin/androidx/room/migration/bundle/ForeignKeyBundleTest.kt
M room/room-migration/src/commonTest/kotlin/androidx/room/migration/bundle/IndexBundleTest.kt
M room/room-migration/src/commonTest/kotlin/androidx/room/migration/bundle/PrimaryKeyBundleTest.kt
A room/room-migration/src/jvmMain/kotlin/androidx/room/migration/bundle/SchemaBundle.jvm.kt
A room/room-migration/src/jvmTest/kotlin/androidx/room/migration/bundle/SerializationTest.kt
A room/room-migration/src/nativeMain/kotlin/androidx/room/migration/bundle/SchemaBundle.native.kt
M room/room-testing/src/androidMain/kotlin/androidx/room/testing/BundleUtil.android.kt
M room/room-testing/src/androidMain/kotlin/androidx/room/testing/MigrationTestHelper.android.kt
ap...@google.com <ap...@google.com> #39
Branch: androidx-main
commit 50564c1275f204c8518fa29999e458bbb64e5a16
Author: Daniel Santiago Rivera <danysantiago@google.com>
Date: Thu Mar 07 11:27:36 2024
Moving room-migration sources to common
This CL just 'git mv' the files to preserve their history.
Bug: 299168035
Test: n/a
Change-Id: Ibf5d0d3af2efe0f6d7dbc68004eee1aea96a33e5
M room/room-migration/src/commonMain/kotlin/androidx/room/migration/bundle/BundleUtil.kt
M room/room-migration/src/commonMain/kotlin/androidx/room/migration/bundle/DatabaseBundle.kt
M room/room-migration/src/commonMain/kotlin/androidx/room/migration/bundle/DatabaseViewBundle.kt
M room/room-migration/src/commonMain/kotlin/androidx/room/migration/bundle/EntityBundle.kt
M room/room-migration/src/commonMain/kotlin/androidx/room/migration/bundle/FieldBundle.kt
M room/room-migration/src/commonMain/kotlin/androidx/room/migration/bundle/ForeignKeyBundle.kt
M room/room-migration/src/commonMain/kotlin/androidx/room/migration/bundle/FtsEntityBundle.kt
M room/room-migration/src/commonMain/kotlin/androidx/room/migration/bundle/FtsOptionsBundle.kt
M room/room-migration/src/commonMain/kotlin/androidx/room/migration/bundle/IndexBundle.kt
D room/room-migration/src/commonMain/kotlin/androidx/room/migration/bundle/Placeholder.kt
M room/room-migration/src/commonMain/kotlin/androidx/room/migration/bundle/PrimaryKeyBundle.kt
M room/room-migration/src/commonMain/kotlin/androidx/room/migration/bundle/SchemaBundle.kt
M room/room-migration/src/commonMain/kotlin/androidx/room/migration/bundle/SchemaEquality.kt
M room/room-migration/src/commonMain/kotlin/androidx/room/migration/bundle/SchemaEqualityUtil.kt
M room/room-migration/src/commonTest/kotlin/androidx/room/migration/bundle/DatabaseBundleTest.kt
M room/room-migration/src/commonTest/kotlin/androidx/room/migration/bundle/DatabaseViewBundleTest.kt
M room/room-migration/src/commonTest/kotlin/androidx/room/migration/bundle/EntityBundleTest.kt
M room/room-migration/src/commonTest/kotlin/androidx/room/migration/bundle/FieldBundleTest.kt
M room/room-migration/src/commonTest/kotlin/androidx/room/migration/bundle/ForeignKeyBundleTest.kt
M room/room-migration/src/commonTest/kotlin/androidx/room/migration/bundle/IndexBundleTest.kt
M room/room-migration/src/commonTest/kotlin/androidx/room/migration/bundle/PrimaryKeyBundleTest.kt
ap...@google.com <ap...@google.com> #40
Branch: androidx-main
commit 40d00b8f4db7912af0e3d16b15af8521cc59a012
Author: Daniel Santiago Rivera <danysantiago@google.com>
Date: Tue Mar 05 20:21:01 2024
Migrate CoroutineFlowResultBinder to driver API
Bug: 299168035
Test: BaseSimpleQueryTest.kt
Change-Id: I38cb247cba868c5975e8f6fa66447604c48c5e73
M room/integration-tests/multiplatformtestapp/src/commonTest/kotlin/androidx/room/integration/multiplatformtestapp/test/BaseSimpleQueryTest.kt
M room/integration-tests/multiplatformtestapp/src/commonTest/kotlin/androidx/room/integration/multiplatformtestapp/test/SampleDatabase.kt
M room/room-compiler/src/main/kotlin/androidx/room/ext/xpoet_ext.kt
M room/room-compiler/src/main/kotlin/androidx/room/solver/query/result/CoroutineFlowResultBinder.kt
M room/room-compiler/src/test/test-data/kotlinCodeGen/coroutines.kt
M room/room-runtime/api/restricted_current.txt
M room/room-runtime/src/androidMain/kotlin/androidx/room/CoroutinesRoom.android.kt
A room/room-runtime/src/commonMain/kotlin/androidx/room/coroutines/FlowBuilder.kt
ap...@google.com <ap...@google.com> #41
Branch: androidx-main
commit a48f5b38acc4cf42ca93825b6fb31269daf572a5
Author: Daniel Santiago Rivera <danysantiago@google.com>
Date: Mon Mar 11 18:22:36 2024
Commonize MigrationTestHelper
Create and expect declaration of MigrationTestHelper with APIs that use SQLite KMP and will use Room's migration algorithm to validate migrations and schema the same way the Android's version does. The strategy is similar to other commonization, the actual declaration will be thin and will delegate most of the logic into common internal functions that can be used in all platforms. All 3 platforms load schemas differently and thus 3 actual declarations are needed. JVM uses files paths and streams, Android uses instrumentation assets and Native uses file paths (in Strings) and Okio.
For backwards compatibility the Android version of the MigrationTestHelper supports creating an instance of it with and without a SQLiteDriver. When no driver is provided, then the helper is in compatibility mode using a SupportSQLiteOpenHelper. In such configuration the KMP APIs that return SQLiteConnection will throw an exception at runtime. Meanwhile if the helper is configured with a driver then the APIs that return SupportSQLiteDatabase will throw an exception.
Various changes in room-runtime were done to support the test helper. MigrationContainer APIs where made library group restricted, while the connection manager was slightly modified to be usable outside room-runtime.
Bug: 299168035
Bug: 317908685
Test: AutoMigrationTest + Existing
Relnote: "Add MigrationTestHelper APIs that work with SQLite KMP APIs"
Change-Id: Ia648230fb1fea3fc9491d1ee93843db3b74e5f7b
M gradle/libs.versions.toml
M room/integration-tests/kotlintestapp/src/androidTest/java/androidx/room/integration/kotlintestapp/migration/MigrationKotlinTest.kt
M room/integration-tests/multiplatformtestapp/build.gradle
M room/integration-tests/multiplatformtestapp/src/androidInstrumentedTest/kotlin/androidx/room/integration/multiplatformtestapp/test/AutoMigrationTest.kt
M room/integration-tests/multiplatformtestapp/src/commonTest/kotlin/androidx/room/integration/multiplatformtestapp/test/BaseAutoMigrationTest.kt
A room/integration-tests/multiplatformtestapp/src/iosTest/kotlin/androidx/room/integration/multiplatformtestapp/test/SchemaDirectory.kt
M room/integration-tests/multiplatformtestapp/src/jvmTest/kotlin/androidx/room/integration/multiplatformtestapp/test/AutoMigrationTest.kt
M room/integration-tests/multiplatformtestapp/src/nativeTest/kotlin/androidx/room/integration/multiplatformtestapp/test/AutoMigrationTest.kt
M room/integration-tests/multiplatformtestapp/src/nativeTest/kotlin/androidx/room/integration/multiplatformtestapp/test/SchemaDirectory.kt
M room/integration-tests/multiplatformtestapp/src/nonIosNativeTest/kotlin/androidx/room/integration/multiplatformtestapp/test/SchemaDirectory.kt
M room/integration-tests/testapp/build.gradle
M room/integration-tests/testapp/src/androidTest/java/androidx/room/integration/testapp/migration/AutoMigrationTest.java
M room/room-migration/build.gradle
M room/room-migration/src/nativeMain/kotlin/androidx/room/migration/bundle/SchemaBundle.native.kt
M room/room-runtime/src/androidMain/kotlin/androidx/room/DatabaseConfiguration.android.kt
M room/room-runtime/src/androidMain/kotlin/androidx/room/Room.android.kt
M room/room-runtime/src/androidMain/kotlin/androidx/room/RoomConnectionManager.android.kt
M room/room-runtime/src/androidMain/kotlin/androidx/room/RoomDatabase.android.kt
M room/room-runtime/src/androidMain/kotlin/androidx/room/driver/SupportSQLiteConnection.android.kt
M room/room-runtime/src/androidMain/kotlin/androidx/room/driver/SupportSQLiteDriver.android.kt
M room/room-runtime/src/androidMain/kotlin/androidx/room/driver/SupportSQLiteStatement.android.kt
M room/room-runtime/src/commonMain/kotlin/androidx/room/Room.kt
M room/room-runtime/src/commonMain/kotlin/androidx/room/RoomConnectionManager.kt
M room/room-runtime/src/commonMain/kotlin/androidx/room/RoomDatabase.kt
M room/room-runtime/src/commonMain/kotlin/androidx/room/util/MigrationUtil.kt
M room/room-runtime/src/jvmMain/kotlin/androidx/room/Room.jvm.kt
M room/room-runtime/src/jvmNativeMain/kotlin/androidx/room/RoomConnectionManager.jvmNative.kt
M room/room-runtime/src/jvmNativeMain/kotlin/androidx/room/RoomDatabase.jvmNative.kt
M room/room-runtime/src/nativeMain/kotlin/androidx/room/Room.native.kt
M room/room-testing/api/current.txt
M room/room-testing/api/restricted_current.txt
M room/room-testing/build.gradle
M room/room-testing/src/androidMain/kotlin/androidx/room/testing/MigrationTestHelper.android.kt
M room/room-testing/src/commonMain/kotlin/androidx/room/testing/BundleUtil.kt
A room/room-testing/src/commonMain/kotlin/androidx/room/testing/MigrationTestHelper.kt
A room/room-testing/src/jvmMain/kotlin/androidx/room/testing/MigrationTestHelper.jvm.kt
A room/room-testing/src/nativeMain/kotlin/androidx/room/testing/MigrationTestHelper.native.kt
ap...@google.com <ap...@google.com> #42
Branch: androidx-main
commit 7821cd4e64b44faffe182127344ea9c140b79731
Author: Daniel Santiago Rivera <danysantiago@google.com>
Date: Mon Mar 18 14:50:06 2024
Add public APIs in RoomDatabase to access connection pool.
Allowing access to the underlying connections used by the RoomDatabase through the connection pool APIs will allow users to perform 'manual' database operations.
These APIs in essence provide the same functionality as the Android SupportSQLite APIs, query(), compileStatement() and runInTransaction(). The mayor difference is that the connection pool APIs are Coroutine based and that unlike Android's runInTransaction(), there is no automatic scheduling of invalidation tracker.
Bug: 299168035
Bug: 329289183
Test: BaseSimpleQueryTest
Relnote: "Add public APIs for accessing database connection via the RoomDatabase connection pool."
Change-Id: I7aa31f5d96e64036aebeed454c539e7433d1a940
M room/integration-tests/multiplatformtestapp/src/commonTest/kotlin/androidx/room/integration/multiplatformtestapp/test/BaseSimpleQueryTest.kt
M room/room-runtime/api/current.txt
M room/room-runtime/api/restricted_current.txt
M room/room-runtime/src/androidMain/kotlin/androidx/room/InvalidationTracker.android.kt
M room/room-runtime/src/androidMain/kotlin/androidx/room/RoomDatabase.android.kt
M room/room-runtime/src/commonMain/kotlin/androidx/room/InvalidationTracker.kt
M room/room-runtime/src/commonMain/kotlin/androidx/room/RoomDatabase.kt
M room/room-runtime/src/commonMain/kotlin/androidx/room/coroutines/ConnectionPool.kt
M room/room-runtime/src/jvmNativeMain/kotlin/androidx/room/InvalidationTracker.jvmNative.kt
M room/room-runtime/src/jvmNativeMain/kotlin/androidx/room/RoomDatabase.jvmNative.kt
ap...@google.com <ap...@google.com> #43
Branch: androidx-main
commit 69f5107bee7239c7b760f6aeca9d8648179e49da
Author: elifbilgin <elifbilgin@google.com>
Date: Fri Nov 03 14:16:11 2023
Adding XProcessingEnv API to include all target platforms for codegen usage.
This CL also introduces two checks for verifying the correct usage of
code language and target platform:
[1] Java codegen is not allowed for any platform other than Android.
[2] Only suspend functions and/or blocking functions with deferred type
return types (e.g. Flow) are allowed in non-Android platforms.
Bug: 299168035
Test: ./gradlew :room:room-compiler:test
Change-Id: Ib8346617830a1aa520de922645eebad027d8dca5
M room/room-compiler-processing/src/main/java/androidx/room/compiler/processing/XProcessingEnv.kt
M room/room-compiler-processing/src/main/java/androidx/room/compiler/processing/javac/JavacProcessingEnv.kt
M room/room-compiler-processing/src/main/java/androidx/room/compiler/processing/ksp/KspProcessingEnv.kt
M room/room-compiler/src/main/kotlin/androidx/room/DatabaseProcessingStep.kt
M room/room-compiler/src/main/kotlin/androidx/room/processor/Context.kt
M room/room-compiler/src/main/kotlin/androidx/room/processor/MethodProcessorDelegate.kt
M room/room-compiler/src/main/kotlin/androidx/room/processor/ProcessorErrors.kt
M room/room-compiler/src/main/kotlin/androidx/room/processor/QueryMethodProcessor.kt
M room/room-compiler/src/main/kotlin/androidx/room/processor/RawQueryMethodProcessor.kt
M room/room-compiler/src/main/kotlin/androidx/room/processor/ShortcutMethodProcessor.kt
M room/room-gradle-plugin/src/test/java/androidx/room/gradle/GradleTestUtils.kt
M room/room-gradle-plugin/src/test/java/androidx/room/gradle/RoomAndroidGradlePluginTest.kt
M room/room-gradle-plugin/src/test/java/androidx/room/gradle/RoomKmpGradlePluginTest.kt
A room/room-gradle-plugin/src/test/test-data/multiplatform-project/src/commonMain/kotlin/room/testapp/CommonDatabase.kt
A room/room-gradle-plugin/src/test/test-data/multiplatform-project/src/jvmMain/kotlin/room/testapp/MyDatabase.kt
M room/room-gradle-plugin/src/test/test-data/multiplatform-project/src/nativeMain/kotlin/room/testapp/MyDatabase.kt
ap...@google.com <ap...@google.com> #44
Branch: androidx-main
commit 5da5756c25ece5b39475911903b0229f3ef66f6a
Author: Daniel Santiago Rivera <danysantiago@google.com>
Date: Thu Apr 11 13:32:28 2024
Use transaction context in compatibility mode for abstract DAO functions
Update Android's performInTransactionSuspending() used to implement @Transaction annotated DAO suspending functions such that if Room is in compatibility mode then the same transaction context of RoomDatabase.withTransaction() is used to confine the SupportSQLiteDatabase.
Bug: 299168035
Test: TransactionCoroutineTest
Change-Id: Id9dc20692610f82268d0aa396cbb33bae7cdeb37
A room/room-runtime/src/androidInstrumentedTest/kotlin/androidx/room/coroutines/TransactionCoroutineTest.kt
M room/room-runtime/src/androidMain/kotlin/androidx/room/RoomDatabase.android.kt
M room/room-runtime/src/androidMain/kotlin/androidx/room/util/DBUtil.android.kt
ap...@google.com <ap...@google.com> #45
Branch: androidx-main
commit 5fae0b6681ca873a35cf572b3910126a3cf64d51
Author: Daniel Santiago Rivera <danysantiago@google.com>
Date: Thu Apr 11 13:23:23 2024
Migrate SingleColumnRowAdapter to driver API
Bug: 299168035
Test: DaoKotlinCodeGenTest
Change-Id: Id1a5775c91ae8b8947387f3848b6b9b939e0b268
M room/room-compiler/src/main/kotlin/androidx/room/solver/query/result/SingleColumnRowAdapter.kt
M room/room-compiler/src/test/kotlin/androidx/room/writer/DaoKotlinCodeGenTest.kt
M room/room-compiler/src/test/test-data/daoWriter/output/javac/ComplexDao.java
M room/room-compiler/src/test/test-data/daoWriter/output/ksp/ComplexDao.java
M room/room-compiler/src/test/test-data/kotlinCodeGen/coroutines.kt
A room/room-compiler/src/test/test-data/kotlinCodeGen/queryResultAdapter_singleColumn.kt
ap...@google.com <ap...@google.com> #46
Branch: androidx-main
commit 55d995d8098a9b7ad7a34a316acfc9c977be605c
Author: Daniel Santiago Rivera <danysantiago@google.com>
Date: Tue Apr 16 09:23:59 2024
Commonize RoomDatabase.Builder.setJournalMode API
Bug: 299168035
Bug: 309995729
Test: BuilderTest
Change-Id: I5b9003149b63e2b5080bf772c840d92c89940b52
M room/integration-tests/multiplatformtestapp/src/commonTest/kotlin/androidx/room/integration/multiplatformtestapp/test/BaseBuilderTest.kt
M room/room-runtime/src/androidMain/kotlin/androidx/room/RoomDatabase.android.kt
M room/room-runtime/src/commonMain/kotlin/androidx/room/RoomDatabase.kt
M room/room-runtime/src/jvmNativeMain/kotlin/androidx/room/RoomDatabase.jvmNative.kt
ap...@google.com <ap...@google.com> #47
Branch: androidx-main
commit 69315f52f7ea34186b2926e2dc949401d7166f7a
Author: Daniel Santiago Rivera <danysantiago@google.com>
Date: Fri Apr 12 17:24:58 2024
Commonize addTypeConverter() API in RoomDatabase.Builder
Also fix converter name in error messages that relied on `KClass.toString()` and now uses `KClass.qualifiedName` which doesn't require Kotlin reflection library.
Bug: 299168035
Bug: 309995729
Test: TypeConverterTest
Change-Id: I440fc9a82f581a36a4946753dea30893f7888180
M room/integration-tests/multiplatformtestapp/src/androidInstrumentedTest/kotlin/androidx/room/integration/multiplatformtestapp/test/QueryTest.kt
M room/integration-tests/multiplatformtestapp/src/androidInstrumentedTest/kotlin/androidx/room/integration/multiplatformtestapp/test/TypeConverterTest.kt
M room/integration-tests/multiplatformtestapp/src/commonTest/kotlin/androidx/room/integration/multiplatformtestapp/test/BaseQueryTest.kt
A room/integration-tests/multiplatformtestapp/src/commonTest/kotlin/androidx/room/integration/multiplatformtestapp/test/BaseTypeConverterTest.kt
M room/integration-tests/multiplatformtestapp/src/jvmTest/kotlin/androidx/room/integration/multiplatformtestapp/test/QueryTest.kt
M room/integration-tests/multiplatformtestapp/src/jvmTest/kotlin/androidx/room/integration/multiplatformtestapp/test/TypeConverterTest.kt
M room/integration-tests/multiplatformtestapp/src/nativeTest/kotlin/androidx/room/integration/multiplatformtestapp/test/QueryTest.kt
M room/integration-tests/multiplatformtestapp/src/nativeTest/kotlin/androidx/room/integration/multiplatformtestapp/test/TypeConverterTest.kt
M room/room-runtime/src/androidMain/kotlin/androidx/room/RoomDatabase.android.kt
M room/room-runtime/src/commonMain/kotlin/androidx/room/RoomDatabase.kt
M room/room-runtime/src/jvmNativeMain/kotlin/androidx/room/RoomDatabase.jvmNative.kt
ap...@google.com <ap...@google.com> #48
Branch: androidx-main
commit f074cd5f0f53184153be13f5edf3b70f13f709e2
Author: Daniel Santiago Rivera <danysantiago@google.com>
Date: Fri Apr 12 13:27:27 2024
Commonize RoomDatabase.Builder APIs for configuring migrations
These are:
* addMigrations
* addAutoMigrationSpec
* fallbackToDestructiveMigration
* fallbackToDestructiveMigrationOnDowngrade
* fallbackToDestructiveMigrationFrom
Also fixed an index out of range bug in validateAutoMigrations()
Bug: 299168035
Bug: 309995729
Test: MigrationTest + AutoMigrationTest
Relnote: Commonize RoomDatabase.Builder APIs regarding migrations.
Change-Id: Ib814a0597899654accb5e41ca5de72ec5e458f5b
A room/integration-tests/multiplatformtestapp/schemas-ksp/androidx.room.integration.multiplatformtestapp.test.BaseAutoMigrationTest.AutoMigrationDatabase/3.json
A room/integration-tests/multiplatformtestapp/schemas-ksp/androidx.room.integration.multiplatformtestapp.test.BaseMigrationTest.MigrationDatabase/1.json
A room/integration-tests/multiplatformtestapp/schemas-ksp/androidx.room.integration.multiplatformtestapp.test.BaseMigrationTest.MigrationDatabase/2.json
A room/integration-tests/multiplatformtestapp/schemas-ksp/androidx.room.integration.multiplatformtestapp.test.BaseMigrationTest.MigrationDatabase/99.json
M room/integration-tests/multiplatformtestapp/src/androidInstrumentedTest/kotlin/androidx/room/integration/multiplatformtestapp/test/AutoMigrationTest.kt
A room/integration-tests/multiplatformtestapp/src/androidInstrumentedTest/kotlin/androidx/room/integration/multiplatformtestapp/test/MigrationTest.kt
M room/integration-tests/multiplatformtestapp/src/commonTest/kotlin/androidx/room/integration/multiplatformtestapp/test/BaseAutoMigrationTest.kt
A room/integration-tests/multiplatformtestapp/src/commonTest/kotlin/androidx/room/integration/multiplatformtestapp/test/BaseMigrationTest.kt
M room/integration-tests/multiplatformtestapp/src/jvmTest/kotlin/androidx/room/integration/multiplatformtestapp/test/AutoMigrationTest.kt
A room/integration-tests/multiplatformtestapp/src/jvmTest/kotlin/androidx/room/integration/multiplatformtestapp/test/MigrationTest.kt
M room/integration-tests/multiplatformtestapp/src/nativeTest/kotlin/androidx/room/integration/multiplatformtestapp/test/AutoMigrationTest.kt
A room/integration-tests/multiplatformtestapp/src/nativeTest/kotlin/androidx/room/integration/multiplatformtestapp/test/MigrationTest.kt
M room/room-runtime/src/androidMain/kotlin/androidx/room/DatabaseConfiguration.android.kt
M room/room-runtime/src/androidMain/kotlin/androidx/room/RoomConnectionManager.android.kt
M room/room-runtime/src/androidMain/kotlin/androidx/room/RoomDatabase.android.kt
M room/room-runtime/src/androidMain/kotlin/androidx/room/migration/Migration.android.kt
M room/room-runtime/src/commonMain/kotlin/androidx/room/DatabaseConfiguration.kt
M room/room-runtime/src/commonMain/kotlin/androidx/room/RoomConnectionManager.kt
M room/room-runtime/src/commonMain/kotlin/androidx/room/RoomDatabase.kt
M room/room-runtime/src/commonMain/kotlin/androidx/room/migration/Migration.kt
M room/room-runtime/src/jvmNativeMain/kotlin/androidx/room/DatabaseConfiguration.jvmNative.kt
M room/room-runtime/src/jvmNativeMain/kotlin/androidx/room/RoomDatabase.jvmNative.kt
M room/room-runtime/src/jvmNativeMain/kotlin/androidx/room/migration/Migration.jvmNative.kt
M room/room-testing/src/jvmMain/kotlin/androidx/room/testing/MigrationTestHelper.jvm.kt
M room/room-testing/src/nativeMain/kotlin/androidx/room/testing/MigrationTestHelper.native.kt
ap...@google.com <ap...@google.com> #49
Branch: androidx-main
commit 97574c45af87fe40f28eeff44a4b3e4e6b0837aa
Author: elifbilgin <elifbilgin@google.com>
Date: Tue Mar 19 19:04:27 2024
Migrating ArrayQueryResultAdapter to use driver APIs.
This CL refactors the ArrayQueryResultAdapter to delegate
to the ListQueryResultAdapter, since SQLStatement API's
do not allow access to the row count as Android's Cursor
did. This workaround is also beneficial in reducing
boilerplate code as well as removing the special handling
of the nullable array types, since the List adapter can
handle this scenario.
The only downside is the conversion from list to an array
is not ideal, but we can circle back to it if we have a
better solution in the future.
Bug: 299168035
Bug: 333903173
Test: DaoKotlinCodeGenTest & BaseSimpleQueryTest
Change-Id: I4fe55163496005ed33de32b61e7c4d39c7a647df
M room/integration-tests/multiplatformtestapp/src/commonTest/kotlin/androidx/room/integration/multiplatformtestapp/test/BaseQueryTest.kt
M room/integration-tests/multiplatformtestapp/src/commonTest/kotlin/androidx/room/integration/multiplatformtestapp/test/SampleDatabase.kt
M room/room-compiler/src/main/kotlin/androidx/room/processor/ProcessorErrors.kt
M room/room-compiler/src/main/kotlin/androidx/room/solver/TypeAdapterStore.kt
M room/room-compiler/src/main/kotlin/androidx/room/solver/query/result/ArrayQueryResultAdapter.kt
M room/room-compiler/src/test/kotlin/androidx/room/processor/QueryMethodProcessorTest.kt
M room/room-compiler/src/test/kotlin/androidx/room/writer/DaoKotlinCodeGenTest.kt
M room/room-compiler/src/test/test-data/daoWriter/output/javac/ComplexDao.java
M room/room-compiler/src/test/test-data/daoWriter/output/ksp/ComplexDao.java
M room/room-compiler/src/test/test-data/kotlinCodeGen/queryResultAdapter_array.kt
ap...@google.com <ap...@google.com> #50
Branch: androidx-main
commit 4937a71e39875ccc5b91fd827440dcf0fa5356c6
Author: elifbilgin <elifbilgin@google.com>
Date: Mon Apr 08 20:24:45 2024
Migrating RelationCollector to driver APIs.
This CL introduces a follow-up TODO item which would be
to add support for LongSparseArray when room-runtime can
depend on androidx.collections in commonMain.
Bug: 299168035
Bug: 333906821
Test: DaoRelationshipKotlinCodeGenTest.kt
Change-Id: I855a47d2afd73993117e4259d68706976cec269f
M room/integration-tests/multiplatformtestapp/src/commonTest/kotlin/androidx/room/integration/multiplatformtestapp/test/BaseQueryTest.kt
M room/integration-tests/multiplatformtestapp/src/commonTest/kotlin/androidx/room/integration/multiplatformtestapp/test/SampleDatabase.kt
M room/room-compiler/src/main/kotlin/androidx/room/processor/ProcessorErrors.kt
M room/room-compiler/src/main/kotlin/androidx/room/solver/query/result/PojoRowAdapter.kt
M room/room-compiler/src/main/kotlin/androidx/room/vo/RelationCollector.kt
M room/room-compiler/src/main/kotlin/androidx/room/writer/RelationCollectorFunctionWriter.kt
M room/room-compiler/src/test/test-data/kotlinCodeGen/relations.kt
M room/room-compiler/src/test/test-data/kotlinCodeGen/relations_arrayMap.kt
M room/room-compiler/src/test/test-data/kotlinCodeGen/relations_byteBufferKey.kt
M room/room-compiler/src/test/test-data/kotlinCodeGen/relations_longSparseArray.kt
M room/room-compiler/src/test/test-data/kotlinCodeGen/relations_nullable.kt
M room/room-runtime/api/restricted_current.txt
M room/room-runtime/src/androidMain/kotlin/androidx/room/util/RelationUtil.android.kt
M room/room-runtime/src/androidMain/kotlin/androidx/room/util/StatementUtil.android.kt
A room/room-runtime/src/commonMain/kotlin/androidx/room/util/RelationUtil.kt
M room/room-runtime/src/commonMain/kotlin/androidx/room/util/SchemaInfoUtil.kt
M room/room-runtime/src/commonMain/kotlin/androidx/room/util/StatementUtil.kt
M room/room-runtime/src/jvmNativeMain/kotlin/androidx/room/util/StatementUtil.jvmNative.kt
ap...@google.com <ap...@google.com> #51
Branch: androidx-main
commit 2975b928247902a8b974a92a59d89a541505974f
Author: Daniel Santiago Rivera <danysantiago@google.com>
Date: Fri May 10 12:36:07 2024
Adjust Room for treating platform nullability a nullable in Kotlin codegen
This CL modifies Room compiler in various small aspects to adjust for treating platform types as nullable when generating Kotlin code:
* Re-order type adapters for nullable version to be a first choice since we want to generate null-safe code when type has unknown nullability.
* If a overriding function has a vararg and the source is from Java, override using an Array type for the vararg param as that can be nullable.
* Update runtime entity adapters to accept nullable types.
Bug: 299168035
Bug: 339809512
Test: ./gradlew :room:room-compiler:test
Change-Id: I15e2a58fc28cdf271bbb39172598432981105f11
M room/room-compiler-processing/src/main/java/androidx/room/compiler/processing/KotlinPoetExt.kt
M room/room-compiler/src/main/kotlin/androidx/room/processor/MethodProcessorDelegate.kt
M room/room-compiler/src/main/kotlin/androidx/room/processor/QueryParameterProcessor.kt
M room/room-compiler/src/main/kotlin/androidx/room/processor/ShortcutParameterProcessor.kt
M room/room-compiler/src/main/kotlin/androidx/room/solver/binderprovider/MultiTypedPagingSourceQueryResultBinderProvider.kt
M room/room-compiler/src/main/kotlin/androidx/room/solver/types/ByteArrayColumnTypeAdapter.kt
M room/room-compiler/src/main/kotlin/androidx/room/solver/types/StringColumnTypeAdapter.kt
M room/room-compiler/src/test/kotlin/androidx/room/processor/CustomConverterProcessorTest.kt
M room/room-compiler/src/test/kotlin/androidx/room/processor/DeleteOrUpdateShortcutMethodProcessorTest.kt
M room/room-compiler/src/test/kotlin/androidx/room/processor/FieldProcessorTest.kt
M room/room-compiler/src/test/kotlin/androidx/room/processor/InsertOrUpsertShortcutMethodProcessorTest.kt
M room/room-compiler/src/test/kotlin/androidx/room/processor/QueryMethodProcessorTest.kt
M room/room-compiler/src/test/kotlin/androidx/room/processor/RawQueryMethodProcessorTest.kt
M room/room-compiler/src/test/kotlin/androidx/room/solver/query/QueryWriterTest.kt
M room/room-compiler/src/test/kotlin/androidx/room/writer/DaoKotlinCodeGenTest.kt
M room/room-compiler/src/test/kotlin/androidx/room/writer/EntityCursorConverterWriterTest.kt
M room/room-compiler/src/test/test-data/daoWriter/output/ksp/ComplexDao.java
M room/room-compiler/src/test/test-data/daoWriter/output/ksp/UpdateDao.java
M room/room-compiler/src/test/test-data/daoWriter/output/ksp/UpsertDao.java
M room/room-compiler/src/test/test-data/daoWriter/output/ksp/WriterDao.java
M room/room-compiler/src/test/test-data/kotlinCodeGen/database_javaSource.kt
A room/room-compiler/src/test/test-data/kotlinCodeGen/guavaCallable_java.kt
M room/room-compiler/src/test/test-data/kotlinCodeGen/overridePropertyQuery.kt
A room/room-compiler/src/test/test-data/kotlinCodeGen/shortcutMethods_java.kt
M room/room-runtime/api/restricted_current.txt
M room/room-runtime/src/commonMain/kotlin/androidx/room/EntityDeleteOrUpdateAdapter.kt
M room/room-runtime/src/commonMain/kotlin/androidx/room/EntityInsertAdapter.kt
M room/room-runtime/src/commonMain/kotlin/androidx/room/EntityUpsertAdapter.kt
ap...@google.com <ap...@google.com> #52
Branch: androidx-main
commit 983be9696d0795e80852e130be8a0ee263b9a971
Author: Daniel Santiago Rivera <danysantiago@google.com>
Date: Thu Jul 25 10:12:40 2024
Migrate ImmutableListQueryResultAdapter to driver APIs
Bug: 299168035
Test: DaoKotlinCodeGenTest
Change-Id: I17c9303b2f700396070c499a57ff1a447c05fc87
M room/room-compiler/src/main/kotlin/androidx/room/solver/query/result/ImmutableListQueryResultAdapter.kt
M room/room-compiler/src/test/test-data/kotlinCodeGen/queryResultAdapter_immutable_list.kt
ap...@google.com <ap...@google.com> #53
Branch: androidx-main
commit 2e6423d55ae4e872291dc75fea69cf40e6cbab82
Author: Daniel Santiago Rivera <danysantiago@google.com>
Date: Thu Jul 25 10:14:31 2024
Migrate OptionalQueryResultAdapter to driver APIs
Bug: 299168035
Test: DaoKotlinCodeGenTest
Change-Id: I9b1e3671ab720160539d616d3cfa22a68f2be59f
M room/room-compiler/src/main/kotlin/androidx/room/solver/query/result/OptionalQueryResultAdapter.kt
M room/room-compiler/src/test/test-data/kotlinCodeGen/queryResultAdapter_optional.kt
ap...@google.com <ap...@google.com> #54
Branch: androidx-main
commit 1d2452240dfd2613c948139b5490415ce6b3fa96
Author: Daniel Santiago Rivera <danysantiago@google.com>
Date: Thu Jul 25 10:18:23 2024
Migrate GuavaOptionalQueryResultAdapter to driver APIs
Bug: 299168035
Test: DaoKotlinCodeGenTest
Change-Id: Ia6fa65ff7955ca9f1d2077dd6e937be0e76aa8e2
M room/room-compiler/src/main/kotlin/androidx/room/solver/query/result/GuavaOptionalQueryResultAdapter.kt
M room/room-compiler/src/test/test-data/kotlinCodeGen/queryResultAdapter_guavaOptional.kt
ap...@google.com <ap...@google.com> #55
Branch: androidx-main
commit 60ac7bdf1c05bd8075d3e79e69222735f723bf03
Author: Daniel Santiago Rivera <danysantiago@google.com>
Date: Thu Jul 25 10:22:40 2024
Migrate GuavaImmutableMultimapQueryResultAdapter to driver APIs
Bug: 299168035
Test: DaoKotlinCodeGenTest
Change-Id: I933011587b5bcaabd0d52ce150ad1257845126cd
M room/room-compiler/src/main/kotlin/androidx/room/solver/query/result/GuavaImmutableMultimapQueryResultAdapter.kt
M room/room-compiler/src/test/test-data/kotlinCodeGen/queryResultAdapter_guavaImmutableMultimap.kt
ap...@google.com <ap...@google.com> #56
Branch: androidx-main
commit 681eefbdd9496294b209397c64114cf0f33f90b1
Author: Daniel Santiago Rivera <danysantiago@google.com>
Date: Thu Jul 25 10:17:13 2024
Migrate ImmutableMapQueryResultAdapter to driver APIs
Bug: 299168035
Test: DaoKotlinCodeGenTest
Change-Id: Ic2582e09857529fe8532dfd27a752e9569a7b958
M room/room-compiler/src/main/kotlin/androidx/room/solver/query/result/ImmutableMapQueryResultAdapter.kt
M room/room-compiler/src/test/test-data/kotlinCodeGen/queryResultAdapter_guavaImmutableMap.kt
n....@gmail.com <n....@gmail.com> #57
Hi, in val supportsDeferForeignKeys = Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP
?
da...@google.com <da...@google.com> #58
If you use BundledSQLiteDriver
then you can safely assume defer_foreign_keys
is available (i.e. supportsDeferForeignKeys
is always true) since that drivers uses SQLite version 3.46.0 and the pragma defer_foreign_keys
is supported since SQLite 3.8.0 (released in 2013-08-26). If you use NativeSQLiteDriver
then the SQLite version is based on the iOS version. Since iOS 8.2 the SQLite version is 3.8.0+ so you can check for iOS versions, or even better, check the SQLite version on the device by executing SELECT sqlite_version()
and reading the version string.
n....@gmail.com <n....@gmail.com> #59
I am using the BundledSQLiteDriver
, thank you<3
el...@google.com <el...@google.com>
ma...@gmail.com <ma...@gmail.com> #60
Maybe you could add a method tableNames to get the names of all the tables, so a temporal implementation of clearAllTables could be done easier.
ae...@gmail.com <ae...@gmail.com> #61
Please fix bug with BundledSQLiteDriver
. I have reported it.
ap...@google.com <ap...@google.com> #62
Project: platform/frameworks/support
Branch: androidx-main
Author: elifbilgin <
Link:
Clean-up all "cursor" mentions in the Room codebase.
Expand for full commit details
Clean-up all "cursor" mentions in the Room codebase.
Since we no longer have Cursor usage in Room KMP (ignoring backwards compat paths), we no longer need to have "cursor" mentions in the KDocs as well as function / variable definitions.
This change also cleans up similar usage in generated code.
Bug: 299168035
Test: Existing tests.
Change-Id: I6e8702adbdcce9f7e71085755ae6340470f785c7
Files:
- M
room/room-compiler/src/main/kotlin/androidx/room/processor/DatabaseViewProcessor.kt
- M
room/room-compiler/src/main/kotlin/androidx/room/processor/EntityOrViewProcessor.kt
- M
room/room-compiler/src/main/kotlin/androidx/room/processor/FieldProcessor.kt
- M
room/room-compiler/src/main/kotlin/androidx/room/processor/PojoProcessor.kt
- M
room/room-compiler/src/main/kotlin/androidx/room/processor/RawQueryMethodProcessor.kt
- M
room/room-compiler/src/main/kotlin/androidx/room/solver/NullAwareTypeConverterStore.kt
- M
room/room-compiler/src/main/kotlin/androidx/room/solver/TypeAdapterStore.kt
- M
room/room-compiler/src/main/kotlin/androidx/room/solver/TypeConverterStore.kt
- M
room/room-compiler/src/main/kotlin/androidx/room/solver/TypeConverterStoreImpl.kt
- M
room/room-compiler/src/main/kotlin/androidx/room/solver/query/result/AmbiguousColumnIndexAdapter.kt
- M
room/room-compiler/src/main/kotlin/androidx/room/solver/query/result/ArrayQueryResultAdapter.kt
- M
room/room-compiler/src/main/kotlin/androidx/room/solver/query/result/BaseObservableQueryResultBinder.kt
- M
room/room-compiler/src/main/kotlin/androidx/room/solver/query/result/CoroutineResultBinder.kt
- M
room/room-compiler/src/main/kotlin/androidx/room/solver/query/result/CursorQueryResultBinder.kt
- M
room/room-compiler/src/main/kotlin/androidx/room/solver/query/result/EntityRowAdapter.kt
- M
room/room-compiler/src/main/kotlin/androidx/room/solver/query/result/GuavaImmutableMultimapQueryResultAdapter.kt
- M
room/room-compiler/src/main/kotlin/androidx/room/solver/query/result/GuavaOptionalQueryResultAdapter.kt
- M
room/room-compiler/src/main/kotlin/androidx/room/solver/query/result/ImmutableListQueryResultAdapter.kt
- M
room/room-compiler/src/main/kotlin/androidx/room/solver/query/result/ImmutableMapQueryResultAdapter.kt
- M
room/room-compiler/src/main/kotlin/androidx/room/solver/query/result/IndexAdapter.kt
- M
room/room-compiler/src/main/kotlin/androidx/room/solver/query/result/ListQueryResultAdapter.kt
- M
room/room-compiler/src/main/kotlin/androidx/room/solver/query/result/MapQueryResultAdapter.kt
- M
room/room-compiler/src/main/kotlin/androidx/room/solver/query/result/MapValueResultAdapter.kt
- M
room/room-compiler/src/main/kotlin/androidx/room/solver/query/result/MultimapQueryResultAdapter.kt
- M
room/room-compiler/src/main/kotlin/androidx/room/solver/query/result/OptionalQueryResultAdapter.kt
- M
room/room-compiler/src/main/kotlin/androidx/room/solver/query/result/PojoIndexAdapter.kt
- M
room/room-compiler/src/main/kotlin/androidx/room/solver/query/result/PojoRowAdapter.kt
- M
room/room-compiler/src/main/kotlin/androidx/room/solver/query/result/QueryResultAdapter.kt
- M
room/room-compiler/src/main/kotlin/androidx/room/solver/query/result/RowAdapter.kt
- M
room/room-compiler/src/main/kotlin/androidx/room/solver/query/result/RxLambdaQueryResultBinder.kt
- M
room/room-compiler/src/main/kotlin/androidx/room/solver/query/result/SingleColumnRowAdapter.kt
- M
room/room-compiler/src/main/kotlin/androidx/room/solver/query/result/SingleItemQueryResultAdapter.kt
- M
room/room-compiler/src/main/kotlin/androidx/room/solver/query/result/SingleNamedColumnRowAdapter.kt
- M
room/room-compiler/src/main/kotlin/androidx/room/solver/types/BoxedPrimitiveColumnTypeAdapter.kt
- M
room/room-compiler/src/main/kotlin/androidx/room/solver/types/ByteArrayColumnTypeAdapter.kt
- M
room/room-compiler/src/main/kotlin/androidx/room/solver/types/ByteArrayWrapperColumnTypeAdapter.kt
- M
room/room-compiler/src/main/kotlin/androidx/room/solver/types/ByteBufferColumnTypeAdapter.kt
- M
room/room-compiler/src/main/kotlin/androidx/room/solver/types/ColumnTypeAdapter.kt
- M
room/room-compiler/src/main/kotlin/androidx/room/solver/types/CompositeAdapter.kt
- M
room/room-compiler/src/main/kotlin/androidx/room/solver/types/EnumColumnTypeAdapter.kt
- M
room/room-compiler/src/main/kotlin/androidx/room/solver/types/PrimitiveColumnTypeAdapter.kt
- M
room/room-compiler/src/main/kotlin/androidx/room/solver/types/StatementValueReader.kt
- M
room/room-compiler/src/main/kotlin/androidx/room/solver/types/StringColumnTypeAdapter.kt
- M
room/room-compiler/src/main/kotlin/androidx/room/solver/types/UuidColumnTypeAdapter.kt
- M
room/room-compiler/src/main/kotlin/androidx/room/solver/types/ValueClassConverterWrapper.kt
- M
room/room-compiler/src/main/kotlin/androidx/room/vo/Field.kt
- M
room/room-compiler/src/main/kotlin/androidx/room/vo/FieldSetter.kt
- M
room/room-compiler/src/main/kotlin/androidx/room/vo/RelationCollector.kt
- M
room/room-compiler/src/main/kotlin/androidx/room/writer/EntityStatementConverterWriter.kt
- M
room/room-compiler/src/main/kotlin/androidx/room/writer/FieldReadWriteWriter.kt
- M
room/room-compiler/src/main/kotlin/androidx/room/writer/RelationCollectorFunctionWriter.kt
- M
room/room-compiler/src/test/kotlin/androidx/room/processor/FieldProcessorTest.kt
- M
room/room-compiler/src/test/kotlin/androidx/room/processor/PojoProcessorTargetMethodTest.kt
- M
room/room-compiler/src/test/kotlin/androidx/room/processor/PojoProcessorTest.kt
- M
room/room-compiler/src/test/kotlin/androidx/room/processor/ProjectionExpanderTest.kt
- M
room/room-compiler/src/test/kotlin/androidx/room/processor/TableEntityProcessorTest.kt
- M
room/room-compiler/src/test/kotlin/androidx/room/processor/autovalue/AutoValuePojoProcessorDelegateTest.kt
- M
room/room-compiler/src/test/kotlin/androidx/room/solver/BasicColumnTypeAdaptersTest.kt
- M
room/room-compiler/src/test/kotlin/androidx/room/solver/NullabilityAwareTypeConverterStoreTest.kt
- M
room/room-compiler/src/test/kotlin/androidx/room/solver/TypeAdapterStoreTest.kt
- M
room/room-compiler/src/test/kotlin/androidx/room/writer/EntityStatementConverterWriterTest.kt
- M
room/room-compiler/src/test/test-data/daoWriter/output/javac/withLambda/ComplexDao.java
- M
room/room-compiler/src/test/test-data/daoWriter/output/javac/withoutLambda/ComplexDao.java
- M
room/room-compiler/src/test/test-data/daoWriter/output/ksp/ComplexDao.java
- M
room/room-compiler/src/test/test-data/kotlinCodeGen/abstractClassWithParam.kt
- M
room/room-compiler/src/test/test-data/kotlinCodeGen/arrayParameterAdapter.kt
- M
room/room-compiler/src/test/test-data/kotlinCodeGen/basicParameterAdapter_string.kt
- M
room/room-compiler/src/test/test-data/kotlinCodeGen/callableQuery_rx2.kt
- M
room/room-compiler/src/test/test-data/kotlinCodeGen/callableQuery_rx3.kt
- M
room/room-compiler/src/test/test-data/kotlinCodeGen/collectionParameterAdapter_string.kt
- M
room/room-compiler/src/test/test-data/kotlinCodeGen/coroutineResultBinder.kt
- M
room/room-compiler/src/test/test-data/kotlinCodeGen/coroutines.kt
- M
room/room-compiler/src/test/test-data/kotlinCodeGen/delegatingFunctions_boxedPrimitiveBridge.kt
- M
room/room-compiler/src/test/test-data/kotlinCodeGen/delegatingFunctions_defaultImplBridge.kt
- M
room/room-compiler/src/test/test-data/kotlinCodeGen/entityRowAdapter.kt
- M
room/room-compiler/src/test/test-data/kotlinCodeGen/guavaCallable.kt
- M
room/room-compiler/src/test/test-data/kotlinCodeGen/guavaCallable_java.kt
- M
room/room-compiler/src/test/test-data/kotlinCodeGen/liveDataCallable.kt
- M
room/room-compiler/src/test/test-data/kotlinCodeGen/multiTypedPagingSourceResultBinder.kt
- M
room/room-compiler/src/test/test-data/kotlinCodeGen/overridePropertyQuery.kt
- M
room/room-compiler/src/test/test-data/kotlinCodeGen/paging_dataSource.kt
- M
room/room-compiler/src/test/test-data/kotlinCodeGen/pojoRowAdapter_boolean.kt
- M
room/room-compiler/src/test/test-data/kotlinCodeGen/pojoRowAdapter_byteArray.kt
- M
room/room-compiler/src/test/test-data/kotlinCodeGen/pojoRowAdapter_customTypeConverter.kt
- M
room/room-compiler/src/test/test-data/kotlinCodeGen/pojoRowAdapter_customTypeConverter_composite.kt
- M
room/room-compiler/src/test/test-data/kotlinCodeGen/pojoRowAdapter_customTypeConverter_internalVisibility.kt
- M
room/room-compiler/src/test/test-data/kotlinCodeGen/pojoRowAdapter_customTypeConverter_nullAware.kt
- M
room/room-compiler/src/test/test-data/kotlinCodeGen/pojoRowAdapter_customTypeConverter_provided.kt
- M
room/room-compiler/src/test/test-data/kotlinCodeGen/pojoRowAdapter_embedded.kt
- M
room/room-compiler/src/test/test-data/kotlinCodeGen/pojoRowAdapter_enum.kt
- M
room/room-compiler/src/test/test-data/kotlinCodeGen/pojoRowAdapter_internalVisibility.kt
- M
room/room-compiler/src/test/test-data/kotlinCodeGen/pojoRowAdapter_otherModule.kt
- M
room/room-compiler/src/test/test-data/kotlinCodeGen/pojoRowAdapter_primitives.kt
- M
room/room-compiler/src/test/test-data/kotlinCodeGen/pojoRowAdapter_primitives_nullable.kt
- M
room/room-compiler/src/test/test-data/kotlinCodeGen/pojoRowAdapter_string.kt
- M
room/room-compiler/src/test/test-data/kotlinCodeGen/pojoRowAdapter_uuid.kt
- M
room/room-compiler/src/test/test-data/kotlinCodeGen/pojoRowAdapter_valueClassConverter.kt
- M
room/room-compiler/src/test/test-data/kotlinCodeGen/pojoRowAdapter_variableProperty.kt
- M
room/room-compiler/src/test/test-data/kotlinCodeGen/pojoRowAdapter_variableProperty_java.kt
- M
room/room-compiler/src/test/test-data/kotlinCodeGen/queryResultAdapter_array.kt
- M
room/room-compiler/src/test/test-data/kotlinCodeGen/queryResultAdapter_guavaImmutableMap.kt
- M
room/room-compiler/src/test/test-data/kotlinCodeGen/queryResultAdapter_guavaImmutableMultimap.kt
- M
room/room-compiler/src/test/test-data/kotlinCodeGen/queryResultAdapter_guavaOptional.kt
- M
room/room-compiler/src/test/test-data/kotlinCodeGen/queryResultAdapter_immutable_list.kt
- M
room/room-compiler/src/test/test-data/kotlinCodeGen/queryResultAdapter_list.kt
- M
room/room-compiler/src/test/test-data/kotlinCodeGen/queryResultAdapter_map.kt
- M
room/room-compiler/src/test/test-data/kotlinCodeGen/queryResultAdapter_map_ambiguousIndexAdapter.kt
- M
room/room-compiler/src/test/test-data/kotlinCodeGen/queryResultAdapter_nestedMap.kt
- M
room/room-compiler/src/test/test-data/kotlinCodeGen/queryResultAdapter_nestedMap_ambiguousIndexAdapter.kt
- M
room/room-compiler/src/test/test-data/kotlinCodeGen/queryResultAdapter_optional.kt
- M
room/room-compiler/src/test/test-data/kotlinCodeGen/rawQuery.kt
- M
room/room-compiler/src/test/test-data/kotlinCodeGen/relations.kt
- M
room/room-compiler/src/test/test-data/kotlinCodeGen/relations_arrayMap.kt
- M
room/room-compiler/src/test/test-data/kotlinCodeGen/relations_byteBufferKey.kt
- M
room/room-compiler/src/test/test-data/kotlinCodeGen/relations_dataSource.kt
- M
room/room-compiler/src/test/test-data/kotlinCodeGen/relations_longSparseArray.kt
- M
room/room-compiler/src/test/test-data/kotlinCodeGen/relations_nullable.kt
Hash: cc5f944fca46302c40d549cd25851618556cb693
Date: Tue Dec 10 11:59:38 2024
ap...@google.com <ap...@google.com> #63
Project: platform/frameworks/support
Branch: androidx-main
Author: elifbilgin <
Link:
Removing unused backwards compat functions.
Expand for full commit details
Removing unused backwards compat functions.
Bug: 299168035
Test: Existing tests.
Change-Id: I5200f42f0c08ed276268c7c8f237eced05d2942d
Files:
- M
room/room-compiler/src/main/kotlin/androidx/room/solver/shortcut/result/DeleteOrUpdateMethodAdapter.kt
- M
room/room-compiler/src/main/kotlin/androidx/room/solver/shortcut/result/InsertOrUpsertMethodAdapter.kt
Hash: 768e850081c3db704dad232c268971d8d8d668ae
Date: Thu Dec 26 15:53:32 2024
ap...@google.com <ap...@google.com> #64
Project: platform/frameworks/support
Branch: androidx-main
Author: Daniel Santiago Rivera <
Link:
Move Room and SQLite (KMP) to beta
Expand for full commit details
Move Room and SQLite (KMP) to beta
Bug: 299168035
Bug: 300660920
Test: n/a
Change-Id: I2cea3da48d841a5da126100dae89b448dbf55520
Files:
- M
libraryversions.toml
- A
room/room-common/api/2.7.0-beta01.txt
- A
room/room-common/api/restricted_2.7.0-beta01.txt
- A
room/room-common/bcv/native/2.7.0-beta01.txt
- A
room/room-external-antlr/api/2.7.0-beta01.txt
- A
room/room-external-antlr/api/restricted_2.7.0-beta01.txt
- A
room/room-guava/api/2.7.0-beta01.txt
- A
room/room-guava/api/res-2.7.0-beta01.txt
- A
room/room-guava/api/restricted_2.7.0-beta01.txt
- A
room/room-ktx/api/2.7.0-beta01.txt
- A
room/room-ktx/api/res-2.7.0-beta01.txt
- A
room/room-ktx/api/restricted_2.7.0-beta01.txt
- A
room/room-migration/api/2.7.0-beta01.txt
- A
room/room-migration/api/restricted_2.7.0-beta01.txt
- A
room/room-migration/bcv/native/2.7.0-beta01.txt
- A
room/room-paging-guava/api/2.7.0-beta01.txt
- A
room/room-paging-guava/api/res-2.7.0-beta01.txt
- A
room/room-paging-guava/api/restricted_2.7.0-beta01.txt
- A
room/room-paging-rxjava2/api/2.7.0-beta01.txt
- A
room/room-paging-rxjava2/api/res-2.7.0-beta01.txt
- A
room/room-paging-rxjava2/api/restricted_2.7.0-beta01.txt
- A
room/room-paging-rxjava3/api/2.7.0-beta01.txt
- A
room/room-paging-rxjava3/api/res-2.7.0-beta01.txt
- A
room/room-paging-rxjava3/api/restricted_2.7.0-beta01.txt
- A
room/room-paging/api/2.7.0-beta01.txt
- A
room/room-paging/api/res-2.7.0-beta01.txt
- A
room/room-paging/api/restricted_2.7.0-beta01.txt
- A
room/room-paging/bcv/native/2.7.0-beta01.txt
- A
room/room-runtime/api/2.7.0-beta01.txt
- A
room/room-runtime/api/res-2.7.0-beta01.txt
- A
room/room-runtime/api/restricted_2.7.0-beta01.txt
- A
room/room-runtime/bcv/native/2.7.0-beta01.txt
- A
room/room-rxjava2/api/2.7.0-beta01.txt
- A
room/room-rxjava2/api/res-2.7.0-beta01.txt
- A
room/room-rxjava2/api/restricted_2.7.0-beta01.txt
- A
room/room-rxjava3/api/2.7.0-beta01.txt
- A
room/room-rxjava3/api/res-2.7.0-beta01.txt
- A
room/room-rxjava3/api/restricted_2.7.0-beta01.txt
- A
room/room-testing/api/2.7.0-beta01.txt
- A
room/room-testing/api/res-2.7.0-beta01.txt
- A
room/room-testing/api/restricted_2.7.0-beta01.txt
- A
room/room-testing/bcv/native/2.7.0-beta01.txt
- A
sqlite/sqlite-bundled/api/2.5.0-beta01.txt
- A
sqlite/sqlite-bundled/api/res-2.5.0-beta01.txt
- A
sqlite/sqlite-bundled/api/restricted_2.5.0-beta01.txt
- A
sqlite/sqlite-bundled/bcv/native/2.5.0-beta01.txt
- A
sqlite/sqlite-framework/api/2.5.0-beta01.txt
- A
sqlite/sqlite-framework/api/res-2.5.0-beta01.txt
- A
sqlite/sqlite-framework/api/restricted_2.5.0-beta01.txt
- A
sqlite/sqlite-framework/bcv/native/2.5.0-beta01.txt
- A
sqlite/sqlite-ktx/api/2.5.0-beta01.txt
- A
sqlite/sqlite-ktx/api/res-2.5.0-beta01.txt
- A
sqlite/sqlite-ktx/api/restricted_2.5.0-beta01.txt
- A
sqlite/sqlite/api/2.5.0-beta01.txt
- A
sqlite/sqlite/api/res-2.5.0-beta01.txt
- A
sqlite/sqlite/api/restricted_2.5.0-beta01.txt
- A
sqlite/sqlite/bcv/native/2.5.0-beta01.txt
Hash: 145dbab84dccbc9868e0199711576662100d1d04
Date: Wed Jan 22 13:57:15 2025
ap...@google.com <ap...@google.com> #65
Project: platform/frameworks/support
Branch: androidx-main
Author: Daniel Santiago Rivera <
Link:
Move Room and SQLite (KMP) to beta
Expand for full commit details
Move Room and SQLite (KMP) to beta
Bug: 299168035
Bug: 300660920
Test: n/a
Change-Id: I41e1bee06bc65264673aab95ee12a2cb84938bae
Files:
- M
libraryversions.toml
- A
room/room-common/api/2.7.0-beta01.txt
- A
room/room-common/api/restricted_2.7.0-beta01.txt
- A
room/room-common/bcv/native/2.7.0-beta01.txt
- A
room/room-external-antlr/api/2.7.0-beta01.txt
- A
room/room-external-antlr/api/restricted_2.7.0-beta01.txt
- A
room/room-guava/api/2.7.0-beta01.txt
- A
room/room-guava/api/res-2.7.0-beta01.txt
- A
room/room-guava/api/restricted_2.7.0-beta01.txt
- A
room/room-ktx/api/2.7.0-beta01.txt
- A
room/room-ktx/api/res-2.7.0-beta01.txt
- A
room/room-ktx/api/restricted_2.7.0-beta01.txt
- A
room/room-migration/api/2.7.0-beta01.txt
- A
room/room-migration/api/restricted_2.7.0-beta01.txt
- A
room/room-migration/bcv/native/2.7.0-beta01.txt
- A
room/room-paging-guava/api/2.7.0-beta01.txt
- A
room/room-paging-guava/api/res-2.7.0-beta01.txt
- A
room/room-paging-guava/api/restricted_2.7.0-beta01.txt
- A
room/room-paging-rxjava2/api/2.7.0-beta01.txt
- A
room/room-paging-rxjava2/api/res-2.7.0-beta01.txt
- A
room/room-paging-rxjava2/api/restricted_2.7.0-beta01.txt
- A
room/room-paging-rxjava3/api/2.7.0-beta01.txt
- A
room/room-paging-rxjava3/api/res-2.7.0-beta01.txt
- A
room/room-paging-rxjava3/api/restricted_2.7.0-beta01.txt
- A
room/room-paging/api/2.7.0-beta01.txt
- A
room/room-paging/api/res-2.7.0-beta01.txt
- A
room/room-paging/api/restricted_2.7.0-beta01.txt
- A
room/room-paging/bcv/native/2.7.0-beta01.txt
- A
room/room-runtime/api/2.7.0-beta01.txt
- A
room/room-runtime/api/res-2.7.0-beta01.txt
- A
room/room-runtime/api/restricted_2.7.0-beta01.txt
- A
room/room-runtime/bcv/native/2.7.0-beta01.txt
- A
room/room-rxjava2/api/2.7.0-beta01.txt
- A
room/room-rxjava2/api/res-2.7.0-beta01.txt
- A
room/room-rxjava2/api/restricted_2.7.0-beta01.txt
- A
room/room-rxjava3/api/2.7.0-beta01.txt
- A
room/room-rxjava3/api/res-2.7.0-beta01.txt
- A
room/room-rxjava3/api/restricted_2.7.0-beta01.txt
- A
room/room-testing/api/2.7.0-beta01.txt
- A
room/room-testing/api/res-2.7.0-beta01.txt
- A
room/room-testing/api/restricted_2.7.0-beta01.txt
- A
room/room-testing/bcv/native/2.7.0-beta01.txt
- A
sqlite/sqlite-bundled/api/2.5.0-beta01.txt
- A
sqlite/sqlite-bundled/api/res-2.5.0-beta01.txt
- A
sqlite/sqlite-bundled/api/restricted_2.5.0-beta01.txt
- A
sqlite/sqlite-bundled/bcv/native/2.5.0-beta01.txt
- A
sqlite/sqlite-framework/api/2.5.0-beta01.txt
- A
sqlite/sqlite-framework/api/res-2.5.0-beta01.txt
- A
sqlite/sqlite-framework/api/restricted_2.5.0-beta01.txt
- A
sqlite/sqlite-framework/bcv/native/2.5.0-beta01.txt
- A
sqlite/sqlite-ktx/api/2.5.0-beta01.txt
- A
sqlite/sqlite-ktx/api/res-2.5.0-beta01.txt
- A
sqlite/sqlite-ktx/api/restricted_2.5.0-beta01.txt
- A
sqlite/sqlite/api/2.5.0-beta01.txt
- A
sqlite/sqlite/api/res-2.5.0-beta01.txt
- A
sqlite/sqlite/api/restricted_2.5.0-beta01.txt
- A
sqlite/sqlite/bcv/native/2.5.0-beta01.txt
Hash: 90099de424174ebef1c53fc3eddaa6d3544b7b4b
Date: Thu Jan 30 13:25:12 2025
ap...@google.com <ap...@google.com> #66
Project: platform/frameworks/support
Branch: androidx-main
Author: Daniel Santiago Rivera <
Link:
Throw error on unsupported Room features with driver
Expand for full commit details
Throw error on unsupported Room features with driver
Without these errors the feature is silently dropped which leads to a bad dev experience.
Bug: 299168035
Test: BuilderTest
Change-Id: I1bd50700ebcfe53aae7457889d6b81141033384f
Files:
- M
room/room-runtime/src/androidMain/kotlin/androidx/room/RoomDatabase.android.kt
- M
room/room-runtime/src/androidUnitTest/kotlin/androidx/room/BuilderTest.kt
Hash: 955b4d2a3845e76931f9f0da5059a6c763ac8df0
Date: Thu Feb 20 13:15:00 2025
Description
Master bug for making Room KMP