Status Update
Comments
el...@google.com <el...@google.com> #2
Hey - Can you share more about your use-case? Is it because you don't know the schema and are pragmatically retrieving data out of the database? Usually applications know the schemas in their database and in general SQLite is very 'loose' on types, i.e. even if an integer is in the column one can read it as a text, see
ap...@google.com <ap...@google.com> #3
The workaround is to call getText() always, but I can't then format numbers using user locale, another problem are binary data.
The implementation is there in native driver, it is just private. What I ask for is make it public (add it to interface) and maybe expose sqlite type constants, but it is not required and easy to workaround.
Here is screenshot from another database viewer (written in PHP) to have better idea about the use case:
Edit: the getColumnType() is used in isNull() method.
el...@google.com <el...@google.com>
na...@google.com <na...@google.com> #4
Makes sense, thank you for your input, I think we can formalize the getColumnType()
API and make it public.
li...@linkly.com.au <li...@linkly.com.au> #5
Project: platform/frameworks/support
Branch: androidx-main
Author: Daniel Santiago Rivera <
Link:
Add API to SQLiteStatement to get a column's data type
Expand for full commit details
Add API to SQLiteStatement to get a column's data type
Bug: 369636251
Relnote: "Add SQLiteStatement.getColumnType() along with the various SQLITE_DATA_* result constants to enable retrieving the data type of a column."
Test: ./sqlite/scripts/runConformanceTest.sh
Change-Id: I1985c7b267ba4d6342cb487cbe6e889bed3ff26d
Files:
- M
room/room-runtime/src/androidMain/kotlin/androidx/room/driver/SupportSQLiteStatement.android.kt
- M
room/room-runtime/src/androidUnitTest/kotlin/androidx/room/InvalidationTrackerTest.kt
- M
room/room-runtime/src/commonMain/kotlin/androidx/room/RoomRawQuery.kt
- M
room/room-runtime/src/commonMain/kotlin/androidx/room/coroutines/ConnectionPoolImpl.kt
- M
sqlite/integration-tests/driver-conformance-test/src/commonTest/kotlin/androidx/sqlite/driver/test/BaseConformanceTest.kt
- M
sqlite/sqlite-bundled/src/jvmAndroidMain/kotlin/androidx/sqlite/driver/bundled/BundledSQLiteStatement.jvmAndroid.kt
- M
sqlite/sqlite-framework/bcv/native/current.txt
- M
sqlite/sqlite-framework/src/androidMain/kotlin/androidx/sqlite/driver/AndroidSQLiteStatement.android.kt
- M
sqlite/sqlite-framework/src/nativeMain/kotlin/androidx/sqlite/driver/NativeSQLiteStatement.kt
- M
sqlite/sqlite/api/current.txt
- M
sqlite/sqlite/api/restricted_current.txt
- M
sqlite/sqlite/bcv/native/current.txt
- M
sqlite/sqlite/src/commonMain/kotlin/androidx/sqlite/SQLite.kt
- M
sqlite/sqlite/src/commonMain/kotlin/androidx/sqlite/SQLiteStatement.kt
Hash: 3001a3332b004f92b2df33ec16f312368e3b2570
Date: Thu Sep 26 21:29:43 2024
el...@google.com <el...@google.com> #7
The following release(s) address this bug.It is possible this bug has only been partially addressed:
androidx.room:room-runtime:2.7.0-alpha10
androidx.room:room-runtime-android:2.7.0-alpha10
androidx.room:room-runtime-macosx64:2.7.0-alpha10
androidx.sqlite:sqlite-bundled-iossimulatorarm64:2.5.0-alpha10
androidx.sqlite:sqlite-bundled-iosx64:2.5.0-alpha10
androidx.sqlite:sqlite-bundled-jvm:2.5.0-alpha10
androidx.sqlite:sqlite-bundled-linuxarm64:2.5.0-alpha10
androidx.sqlite:sqlite-bundled-linuxx64:2.5.0-alpha10
androidx.sqlite:sqlite-bundled-macosarm64:2.5.0-alpha10
androidx.sqlite:sqlite-bundled-macosx64:2.5.0-alpha10
androidx.sqlite:sqlite-framework:2.5.0-alpha10
androidx.sqlite:sqlite-framework-android:2.5.0-alpha10
androidx.sqlite:sqlite-framework-iosarm64:2.5.0-alpha10
androidx.sqlite:sqlite-framework-iossimulatorarm64:2.5.0-alpha10
androidx.sqlite:sqlite-framework-iosx64:2.5.0-alpha10
androidx.sqlite:sqlite-framework-linuxarm64:2.5.0-alpha10
androidx.sqlite:sqlite-framework-linuxx64:2.5.0-alpha10
androidx.sqlite:sqlite-framework-macosarm64:2.5.0-alpha10
androidx.sqlite:sqlite-framework-macosx64:2.5.0-alpha10
androidx.sqlite:sqlite-iosarm64:2.5.0-alpha10
androidx.sqlite:sqlite-iossimulatorarm64:2.5.0-alpha10
androidx.sqlite:sqlite-iosx64:2.5.0-alpha10
androidx.sqlite:sqlite-jvm:2.5.0-alpha10
androidx.sqlite:sqlite-linuxarm64:2.5.0-alpha10
androidx.sqlite:sqlite-linuxx64:2.5.0-alpha10
androidx.sqlite:sqlite-macosarm64:2.5.0-alpha10
androidx.sqlite:sqlite-macosx64:2.5.0-alpha10
el...@google.com <el...@google.com> #8
Closing this issue now, please let us know if the issue persists.
Description
Component used: Room Version used: 2.7.0-alpha-07 (multiplatform) Devices/Android versions reproduced on: No run device needed. Only a Mac to compile on iOS
If this is a bug in the library, we would appreciate if you could attach:
Tested commands :
I'm using a relation with Kotlin Uuid (experimental in 2.0.20) mapped to ByteArray (with UuidTypeAdapter) and stored as BLOB in the database. When I try to run the ksp task to generate iOS code, an error occurs.
I suppose the same issue happens for every non JVM targets.
When I don't use relation (Replace MyEntityEmbed by MyFirstEntity in MyDao), the code compiles correctly.
I think room tries to generate a code near to the one generated for android which uses ByteBuffer to decode BLOBs.