mirror of
https://github.com/PluralKit/PluralKit.git
synced 2026-02-10 07:47:53 +00:00
Extract Database to interface
This commit is contained in:
parent
70df9cd893
commit
90ac186183
27 changed files with 76 additions and 54 deletions
|
|
@ -7,7 +7,7 @@ using Dapper;
|
|||
namespace PluralKit.Core {
|
||||
public static class ConnectionUtils
|
||||
{
|
||||
public static async IAsyncEnumerable<T> QueryStreamAsync<T>(this Database connFactory, string sql, object param)
|
||||
public static async IAsyncEnumerable<T> QueryStreamAsync<T>(this IDatabase connFactory, string sql, object param)
|
||||
{
|
||||
await using var conn = await connFactory.Obtain();
|
||||
|
||||
|
|
|
|||
|
|
@ -10,6 +10,11 @@ using NodaTime.Serialization.JsonNet;
|
|||
namespace PluralKit.Core {
|
||||
public static class InitUtils
|
||||
{
|
||||
public static void InitStatic()
|
||||
{
|
||||
Database.InitStatic();
|
||||
}
|
||||
|
||||
public static IConfigurationBuilder BuildConfiguration(string[] args) => new ConfigurationBuilder()
|
||||
.SetBasePath(Directory.GetCurrentDirectory())
|
||||
.AddJsonFile("pluralkit.conf", true)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue