using System.Runtime.CompilerServices; using SqlKata; namespace PluralKit.Core; public interface IDatabase { Task ApplyMigrations(); Task Obtain(bool messages = false); Task Execute(Func func); Task Execute(Func> func); IAsyncEnumerable Execute(Func> func); Task ExecuteQuery(Query q, string extraSql = "", [CallerMemberName] string queryName = "", bool messages = false); Task ExecuteQuery(IPKConnection? conn, Query q, string extraSql = "", [CallerMemberName] string queryName = ""); Task QueryFirst(string q, object param = null, [CallerMemberName] string queryName = "", bool messages = false); 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); }