refactor: add SqlKata for SQL generation, move connection handling into ModelRepository

This commit is contained in:
spiral
2021-09-29 21:51:38 -04:00
parent 6251d29abb
commit 92e45a07ff
60 changed files with 806 additions and 640 deletions

View File

@@ -1,10 +1,13 @@
using SqlKata;
namespace PluralKit.Core
{
public class AccountPatch: PatchObject
{
public Partial<bool> AllowAutoproxy { get; set; }
public override UpdateQueryBuilder Apply(UpdateQueryBuilder b) => b
.With("allow_autoproxy", AllowAutoproxy);
public override Query Apply(Query q) => q.ApplyPatch(wrapper => wrapper
.With("allow_autoproxy", AllowAutoproxy)
);
}
}