Several more database-y refactors
- DbConnectionFactory renamed to "Database", will now be the primary entry point for DB stuff - Created IPKConnection interface mostly containing async extensions to IDbConnection, use this going forward - Reworked the Connection/Command wrappers (that have performance/logging extensions) - Probably more stuff that I forgot???
This commit is contained in:
17
PluralKit.Core/Database/Wrappers/IPKCommand.cs
Normal file
17
PluralKit.Core/Database/Wrappers/IPKCommand.cs
Normal file
@@ -0,0 +1,17 @@
|
||||
using System;
|
||||
using System.Data;
|
||||
using System.Data.Common;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace PluralKit.Core
|
||||
{
|
||||
public interface IPKCommand: IDbCommand, IAsyncDisposable
|
||||
{
|
||||
public Task PrepareAsync(CancellationToken ct = default);
|
||||
public Task<int> ExecuteNonQueryAsync(CancellationToken ct = default);
|
||||
public Task<object> ExecuteScalarAsync(CancellationToken ct = default);
|
||||
public Task<DbDataReader> ExecuteReaderAsync(CancellationToken ct = default);
|
||||
public Task<DbDataReader> ExecuteReaderAsync(CommandBehavior behavior, CancellationToken ct = default);
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user