isTableExisted static method

Future<bool> isTableExisted(
  1. DatabaseExecutor db,
  2. String tableName
)

Check if current table created success using "sqlite_master"

Implementation

static Future<bool> isTableExisted(DatabaseExecutor db, String tableName) async {
  // SELECT count(1) FROM sqlite_master WHERE type="table" AND name = "$tableName";
  int? value =
      await selectCount(db, "sqlite_master", where: "WHERE type= ? AND name = ? ", whereArgs: ["table", tableName]);
  return value != null && value > 0;
}