Improve the performance of the migration by ~4x.

This commit is contained in:
Greyson Parrelli
2022-12-15 12:53:21 -05:00
parent 32b66643c5
commit 4d9dc42868
7 changed files with 150 additions and 2 deletions

View File

@@ -44,6 +44,7 @@ object SqlUtil {
return tables
}
@JvmStatic
fun getNextAutoIncrementId(db: SupportSQLiteDatabase, table: String): Long {
db.query("SELECT * FROM sqlite_sequence WHERE name = ?", arrayOf(table)).use { cursor ->
if (cursor.moveToFirst()) {