mirror of
https://github.com/PluralKit/PluralKit.git
synced 2026-02-04 13:06:50 +00:00
Add command to delete all switches
This commit is contained in:
parent
1e1f2acdc3
commit
7c3b4b9af9
4 changed files with 25 additions and 0 deletions
|
|
@ -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())
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue