@@ -37,9 +37,9 @@ internal class AndroidDatabaseConnection(private val database: SQLiteDatabase) :
3737
3838 override fun executeUpdateDelete (sql : String , bindParams : Array <out Any ?>? ) = execSQL(sql, bindParams)
3939
40- override fun query (sql : String , bindParams : Array <out Any ?>? ): CommonCursor =
41- if (bindParams == null ) {
42- AndroidCursor ( database.rawQuery(sql, null ) )
40+ override fun query (sql : String , bindParams : Array <out Any ?>? ): CommonCursor {
41+ val cursor = if (bindParams == null ) {
42+ database.rawQuery(sql, null )
4343 } else {
4444 // Use rawQueryWithFactory to bind parameters with proper types
4545 // This allows us to bind parameters with their actual types (Int, Long, Double, etc.)
@@ -50,8 +50,10 @@ internal class AndroidDatabaseConnection(private val database: SQLiteDatabase) :
5050 }
5151 // Pass emptyArray() for selectionArgs since we bind parameters via the factory
5252 // Use empty string for editTable since it's only needed for updateable cursors
53- AndroidCursor ( database.rawQueryWithFactory(cursorFactory, sql, null , " " ) )
53+ database.rawQueryWithFactory(cursorFactory, sql, null , " " )
5454 }
55+ return AndroidCursor (cursor)
56+ }
5557
5658 /* *
5759 * Binds parameters to SQLiteQuery with proper type handling.
0 commit comments