removing null values for bindArgs so database plugin doesn't throw exception for beta builds
Summary: Removing use of ```database.query``` with null values because its stopping the database plugin from working for whatsapp android. The [release version of FrameworkSQLiteDatabase](https://androidx.tech/artifacts/sqlite/sqlite-framework/2.2.0-source/androidx/sqlite/db/framework/FrameworkSQLiteDatabase.java.html) is written in java which accepts a null value (although its still annotated NonNull for Object[] bindArgs) But the [beta version of FrameworkSQLiteDatabase](https://androidx.tech/artifacts/sqlite/sqlite-framework/2.3.0-beta01-source/androidx/sqlite/db/framework/FrameworkSQLiteDatabase.kt.html) is written in kotlin which throws an exception for null values. Reviewed By: passy, mweststrate Differential Revision: D40870552 fbshipit-source-id: 72c99c1b62d052887d298145a3019d6123ea94f3
This commit is contained in:
committed by
Facebook GitHub Bot
parent
226ccf91f6
commit
42ecf919d6
@@ -162,9 +162,9 @@ public class SqliteDatabaseDriver extends DatabaseDriver<SqliteDatabaseDescripto
|
||||
SupportSQLiteDatabase database =
|
||||
sqliteDatabaseConnectionProvider.openDatabase(databaseDescriptor.file);
|
||||
try {
|
||||
Cursor structureCursor = database.query("PRAGMA table_info(" + table + ")", null);
|
||||
Cursor foreignKeysCursor = database.query("PRAGMA foreign_key_list(" + table + ")", null);
|
||||
Cursor indexesCursor = database.query("PRAGMA index_list(" + table + ")", null);
|
||||
Cursor structureCursor = database.query("PRAGMA table_info(" + table + ")");
|
||||
Cursor foreignKeysCursor = database.query("PRAGMA foreign_key_list(" + table + ")");
|
||||
Cursor indexesCursor = database.query("PRAGMA index_list(" + table + ")");
|
||||
|
||||
try {
|
||||
// Structure & foreign keys
|
||||
@@ -210,7 +210,7 @@ public class SqliteDatabaseDriver extends DatabaseDriver<SqliteDatabaseDescripto
|
||||
while (indexesCursor.moveToNext()) {
|
||||
List<String> indexedColumnNames = new ArrayList<>();
|
||||
String indexName = indexesCursor.getString(indexesCursor.getColumnIndex("name"));
|
||||
Cursor indexInfoCursor = database.query("PRAGMA index_info(" + indexName + ")", null);
|
||||
Cursor indexInfoCursor = database.query("PRAGMA index_info(" + indexName + ")");
|
||||
try {
|
||||
while (indexInfoCursor.moveToNext()) {
|
||||
indexedColumnNames.add(
|
||||
@@ -307,7 +307,7 @@ public class SqliteDatabaseDriver extends DatabaseDriver<SqliteDatabaseDescripto
|
||||
|
||||
private static DatabaseExecuteSqlResponse executeSelect(
|
||||
SupportSQLiteDatabase database, String query) {
|
||||
Cursor cursor = database.query(query, null);
|
||||
Cursor cursor = database.query(query);
|
||||
try {
|
||||
String[] columnNames = cursor.getColumnNames();
|
||||
List<List<Object>> rows = cursorToList(cursor);
|
||||
|
||||
Reference in New Issue
Block a user