Hi, we are using sqldelight and we have perform a ...
# squarelibraries
m
Hi, we are using sqldelight and we have perform a destructive migration. We found this for deleting all the db tables https://github.com/cashapp/sqldelight/discussions/2476#discussioncomment-1040220
Copy code
val tables = driver.executeQuery(null, "SELECT name FROM sqlite_master WHERE type='table';", 0).use {
      buildList {
        while (it.next()) {
          val name = it.getString(0)!!
          if (name != "sqlite_sequence" && name != "android_metadata") {
            add(name)
          }
        }
      }
    }
    for (table in tables) {
      driver.execute(null, "DROP TABLE $table", 0)
    }
    Database.Schema.create(driver)
We have the following doubts: • Is this logic safe? Could be device or os dependent or be broken by library updates? • What is the correspondent for ios?