mirror of
https://github.com/PluralKit/PluralKit.git
synced 2026-02-04 13:06:50 +00:00
Retire more IDataStore methods
This commit is contained in:
parent
9c1efc7886
commit
467ce78522
8 changed files with 54 additions and 152 deletions
|
|
@ -16,7 +16,12 @@ namespace PluralKit.Core
|
|||
|
||||
public static Task DeleteSystem(this IPKConnection conn, SystemId id) =>
|
||||
conn.ExecuteAsync("delete from systems where id = @Id", new {Id = id});
|
||||
|
||||
|
||||
public static Task<PKMember> CreateMember(this IPKConnection conn, SystemId system, string memberName) =>
|
||||
conn.QueryFirstAsync<PKMember>(
|
||||
"insert into members (hid, system, name) values (find_free_member_hid(), @SystemId, @Name) returning *",
|
||||
new {SystemId = system, Name = memberName});
|
||||
|
||||
public static Task<PKMember> UpdateMember(this IPKConnection conn, MemberId id, MemberPatch patch)
|
||||
{
|
||||
var (query, pms) = patch.Apply(new UpdateQueryBuilder("members", "id = @id"))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue