Add command to delete all switches
This commit is contained in:
@@ -303,6 +303,11 @@ namespace PluralKit {
|
||||
/// </summary>
|
||||
Task DeleteSwitch(PKSwitch sw);
|
||||
|
||||
/// <summary>
|
||||
/// Deletes all switches in a given system from the data store.
|
||||
/// </summary>
|
||||
Task DeleteAllSwitches(PKSystem system);
|
||||
|
||||
/// <summary>
|
||||
/// Gets the total amount of systems in the data store.
|
||||
/// </summary>
|
||||
@@ -416,6 +421,12 @@ namespace PluralKit {
|
||||
return await conn.QueryAsync<ulong>("select uid from accounts where system = @Id", new { Id = system.Id });
|
||||
}
|
||||
|
||||
public async Task DeleteAllSwitches(PKSystem system)
|
||||
{
|
||||
using (var conn = await _conn.Obtain())
|
||||
await conn.ExecuteAsync("delete from switches where system = @Id", system);
|
||||
}
|
||||
|
||||
public async Task<ulong> GetTotalSystems()
|
||||
{
|
||||
using (var conn = await _conn.Obtain())
|
||||
|
||||
Reference in New Issue
Block a user