MCPcopy Create free account
hub / github.com/M66B/FairEmail / readColumns

Method readColumns

app/src/main/java/androidx/room/FtsTableInfo.java:86–101  ·  view source on GitHub ↗
(SupportSQLiteDatabase database, String tableName)

Source from the content-addressed store, hash-verified

84 }
85
86 @SuppressWarnings("TryFinallyCanBeTryWithResources")
87 private static Set<String> readColumns(SupportSQLiteDatabase database, String tableName) {
88 Cursor cursor = database.query("PRAGMA table_info(`" + tableName + "`)");
89 Set<String> columns = new HashSet<>();
90 try {
91 if (cursor.getColumnCount() > 0) {
92 int nameIndex = cursor.getColumnIndex("name");
93 while (cursor.moveToNext()) {
94 columns.add(cursor.getString(nameIndex));
95 }
96 }
97 } finally {
98 cursor.close();
99 }
100 return columns;
101 }
102
103 @SuppressWarnings("TryFinallyCanBeTryWithResources")
104 private static Set<String> readOptions(SupportSQLiteDatabase database, String tableName) {

Callers 1

readMethod · 0.95

Calls 7

moveToNextMethod · 0.80
queryMethod · 0.45
getColumnCountMethod · 0.45
getColumnIndexMethod · 0.45
addMethod · 0.45
getStringMethod · 0.45
closeMethod · 0.45

Tested by

no test coverage detected