mirror of
https://github.com/PluralKit/PluralKit.git
synced 2026-02-04 13:06:50 +00:00
Extract system/member guild settings and refactor DB access
(also refactor MemberAvatar now that I'm here)
This commit is contained in:
parent
ed511a6236
commit
a915ddb41c
13 changed files with 247 additions and 272 deletions
|
|
@ -311,6 +311,11 @@ namespace PluralKit.Core
|
|||
|
||||
public static class DatabaseExt
|
||||
{
|
||||
public static async Task Execute(this DbConnectionFactory db, Func<IDbConnection, Task> func)
|
||||
{
|
||||
await using var conn = await db.Obtain();
|
||||
await func(conn);
|
||||
}
|
||||
public static async Task<T> Execute<T>(this DbConnectionFactory db, Func<IDbConnection, Task<T>> func)
|
||||
{
|
||||
await using var conn = await db.Obtain();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue