mirror of
https://github.com/PluralKit/PluralKit.git
synced 2026-02-09 15:27:54 +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
|
|
@ -1,10 +1,25 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
using SqlKata;
|
||||
|
||||
namespace PluralKit.Core
|
||||
{
|
||||
public interface IDatabase
|
||||
{
|
||||
Task ApplyMigrations();
|
||||
Task<IPKConnection> Obtain();
|
||||
Task Execute(Func<IPKConnection, Task> func);
|
||||
Task<T> Execute<T>(Func<IPKConnection, Task<T>> func);
|
||||
IAsyncEnumerable<T> Execute<T>(Func<IPKConnection, IAsyncEnumerable<T>> func);
|
||||
Task<int> ExecuteQuery(Query q, string extraSql = "", [CallerMemberName] string queryName = "");
|
||||
Task<T> QueryFirst<T>(Query q, string extraSql = "", [CallerMemberName] string queryName = "");
|
||||
Task<T> QueryFirst<T>(IPKConnection? conn, Query q, string extraSql = "", [CallerMemberName] string queryName = "");
|
||||
Task<IEnumerable<T>> Query<T>(Query q, [CallerMemberName] string queryName = "");
|
||||
IAsyncEnumerable<T> QueryStream<T>(Query q, [CallerMemberName] string queryName = "");
|
||||
Task<T> QuerySingleProcedure<T>(string queryName, object param);
|
||||
Task<IEnumerable<T>> QueryProcedure<T>(string queryName, object param);
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue