This commit is contained in:
Jamie.Rees 2016-11-07 14:46:44 +00:00
parent ac02d24d65
commit 367ca391b1
7 changed files with 160 additions and 0 deletions

View file

@ -327,5 +327,22 @@ namespace PlexRequests.Store.Repository
throw;
}
}
public async Task DeleteAllAsync(string tableName)
{
try
{
ResetCache();
using (var db = Config.DbConnection())
{
db.Open();
await db.ExecuteAsync($"delete from {tableName}");
}
}
catch (SqliteException e) when (e.ErrorCode == SQLiteErrorCode.Corrupt)
{
Log.Fatal(CorruptMessage);
throw;
}
}
}
}