mirror of
https://github.com/PluralKit/PluralKit.git
synced 2026-02-04 04:56:49 +00:00
group import/export
This commit is contained in:
parent
a09f819924
commit
bc2c198a82
8 changed files with 219 additions and 9 deletions
|
|
@ -27,6 +27,9 @@ namespace PluralKit.Core
|
|||
public IAsyncEnumerable<PKMember> GetSystemMembers(IPKConnection conn, SystemId system) =>
|
||||
conn.QueryStreamAsync<PKMember>("select * from members where system = @SystemID", new { SystemID = system });
|
||||
|
||||
public IAsyncEnumerable<PKGroup> GetSystemGroups(IPKConnection conn, SystemId system) =>
|
||||
conn.QueryStreamAsync<PKGroup>("select * from groups where system = @System", new { System = system });
|
||||
|
||||
public Task<int> GetSystemMemberCount(IPKConnection conn, SystemId id, PrivacyLevel? privacyFilter = null)
|
||||
{
|
||||
var query = new StringBuilder("select count(*) from members where system = @Id");
|
||||
|
|
@ -35,6 +38,9 @@ namespace PluralKit.Core
|
|||
return conn.QuerySingleAsync<int>(query.ToString(), new { Id = id });
|
||||
}
|
||||
|
||||
public Task<int> GetSystemGroupCount(IPKConnection conn, SystemId id) =>
|
||||
conn.QuerySingleAsync<int>("select count(*) from groups where system = @System", new { System = id });
|
||||
|
||||
public async Task<PKSystem> CreateSystem(IPKConnection conn, string? systemName = null, IPKTransaction? tx = null)
|
||||
{
|
||||
var system = await conn.QuerySingleAsync<PKSystem>(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue