truncate method

  1. @override
Future<bool> truncate({
  1. bool force = false,
})
inherited

Implementation

@override
Future<bool> truncate({bool force = false}) async {
  try {
    String sql = "TRUNCATE TABLE $getTable";
    if (force) {
      sql = "SET FOREIGN_KEY_CHECKS=0; $sql; SET FOREIGN_KEY_CHECKS=1;";
    }
    conn = await getConnection();
    await conn.execute(sql);
    return true;
  } catch (e) {
    rethrow;
  }
}