Skip to content

Commit

Permalink
Add some logs for deleteing database file
Browse files Browse the repository at this point in the history
  • Loading branch information
qiaoyuang committed Sep 18, 2023
1 parent 00999cd commit dea2414
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,10 @@ public actual fun deleteDatabase(path: DatabasePath, name: String): Boolean {
if (it.exists())
it.delete()
}
return File(baseName).delete()
val result = File(baseName).delete()
if (!result)
println("Delete the database file failed, file path: $baseName")
return result
}

internal fun DatabaseConnection.migrateIfNeeded(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -119,5 +119,8 @@ public actual fun deleteDatabase(path: DatabasePath, name: String): Boolean {
remove("$baseName-shm")
remove("$baseName-wal")
remove("$baseName-journal")
return remove(baseName) == 0
val result = remove(baseName) == 0
if (!result)
println("Delete the database file failed, file path: $baseName")
return result
}

0 comments on commit dea2414

Please sign in to comment.