mirror of
https://github.com/PluralKit/PluralKit.git
synced 2026-02-07 06:17:55 +00:00
refactor: add SqlKata for SQL generation, move connection handling into ModelRepository
This commit is contained in:
parent
6251d29abb
commit
92e45a07ff
60 changed files with 806 additions and 640 deletions
|
|
@ -6,6 +6,8 @@ using NodaTime;
|
|||
|
||||
using Newtonsoft.Json.Linq;
|
||||
|
||||
using SqlKata;
|
||||
|
||||
namespace PluralKit.Core
|
||||
{
|
||||
public class MemberPatch: PatchObject
|
||||
|
|
@ -31,7 +33,7 @@ namespace PluralKit.Core
|
|||
public Partial<PrivacyLevel> AvatarPrivacy { get; set; }
|
||||
public Partial<PrivacyLevel> MetadataPrivacy { get; set; }
|
||||
|
||||
public override UpdateQueryBuilder Apply(UpdateQueryBuilder b) => b
|
||||
public override Query Apply(Query q) => q.ApplyPatch(wrapper => wrapper
|
||||
.With("name", Name)
|
||||
.With("hid", Hid)
|
||||
.With("display_name", DisplayName)
|
||||
|
|
@ -51,7 +53,8 @@ namespace PluralKit.Core
|
|||
.With("pronoun_privacy", PronounPrivacy)
|
||||
.With("birthday_privacy", BirthdayPrivacy)
|
||||
.With("avatar_privacy", AvatarPrivacy)
|
||||
.With("metadata_privacy", MetadataPrivacy);
|
||||
.With("metadata_privacy", MetadataPrivacy)
|
||||
);
|
||||
|
||||
public new void AssertIsValid()
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue