feat: use sqlkata for a few more queries

This commit is contained in:
spiral
2022-12-03 12:04:12 +00:00
parent 8a727c6e80
commit b2e4ff38e3
5 changed files with 8 additions and 15 deletions

View File

@@ -7,7 +7,7 @@ namespace PluralKit.Core;
public partial class ModelRepository
{
public async Task<ulong?> GetDmChannel(ulong id)
=> await _db.Execute(c => c.QueryFirstOrDefaultAsync<ulong?>("select dm_channel from accounts where uid = @id", new { id = id }));
=> await _db.QueryFirst<ulong?>(new Query("accounts").Select("dm_channel").Where("uid", id));
public async Task<bool> GetAutoproxyEnabled(ulong id)
=> await _db.QueryFirst<bool>(new Query("accounts").Select("allow_autoproxy").Where("uid", id));