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 Obtain(); Task Execute(Func func); Task Execute(Func> func); IAsyncEnumerable Execute(Func> func); Task ExecuteQuery(Query q, string extraSql = "", [CallerMemberName] string queryName = ""); Task ExecuteQuery(IPKConnection? conn, Query q, string extraSql = "", [CallerMemberName] string queryName = ""); Task QueryFirst(Query q, string extraSql = "", [CallerMemberName] string queryName = ""); Task QueryFirst(IPKConnection? conn, Query q, string extraSql = "", [CallerMemberName] string queryName = ""); Task> Query(Query q, [CallerMemberName] string queryName = ""); IAsyncEnumerable QueryStream(Query q, [CallerMemberName] string queryName = ""); Task QuerySingleProcedure(string queryName, object param); Task> QueryProcedure(string queryName, object param); } }