This commit is contained in:
Jamie.Rees 2016-11-07 14:46:44 +00:00
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;
}
}
}
}

View file

@ -85,5 +85,6 @@ namespace PlexRequests.Store.Repository
IEnumerable<T> Custom(Func<IDbConnection, IEnumerable<T>> func);
Task<IEnumerable<T>> CustomAsync(Func<IDbConnection, Task<IEnumerable<T>>> func);
void DeleteAll(string tableName);
Task DeleteAllAsync(string tableName);
}
}