找不到 `fun Cursor.getString(columnName: String): String` 实现

Can't find `fun Cursor.getString(columnName: String): String` implementation

这些功能在哪里实现的?

https://android.github.io/android-ktx/core-ktx/androidx.database/android.database.-cursor/index.html

我看到了包 androidx.core.database 但找不到实现。 只有这些功能

inline fun Cursor.getBlobOrNull(index: Int) = if (isNull(index)) null else getBlob(index)
inline fun Cursor.getDoubleOrNull(index: Int) = if (isNull(index)) null else getDouble(index)
inline fun Cursor.getFloatOrNull(index: Int) = if (isNull(index)) null else getFloat(index)
inline fun Cursor.getIntOrNull(index: Int) = if (isNull(index)) null else getInt(index)
inline fun Cursor.getLongOrNull(index: Int) = if (isNull(index)) null else getLong(index)
inline fun Cursor.getShortOrNull(index: Int) = if (isNull(index)) null else getShort(index)
inline fun Cursor.getStringOrNull(index: Int) = if (isNull(index)) null else getString(index)

Cursor 的基于名称的扩展名已被 Jake Wharton 删除。

用他的话说:

They encourage a pattern of inefficiency. You should look up the column names once prior to iteration or use a higher-level abstraction like Room or SQL Delight which does that for you.

您可以在此处找到此软件包的完整 git 历史记录: https://android.googlesource.com/platform/frameworks/support/+log/android-room-release/core/ktx/src/main/java/androidx/core/database