using System;
using System.Threading;
using System.Threading.Tasks;
using Microsoft.EntityFrameworkCore;
namespace Jellyfin.Server.Implementations;
///
/// Defines the type and extension points for multi database support.
///
public interface IJellyfinDatabaseProvider
{
///
/// Gets or Sets the Database Factory when initialisaition is done.
///
IDbContextFactory? DbContextFactory { get; set; }
///
/// Initialises jellyfins EFCore database access.
///
/// The EFCore database options.
void Initialise(DbContextOptionsBuilder options);
///
/// Will be invoked when EFCore wants to build its model.
///
/// The ModelBuilder from EFCore.
void OnModelCreating(ModelBuilder modelBuilder);
///
/// If supported this should run any periodic maintaince tasks.
///
/// The token to abort the operation.
/// A representing the asynchronous operation.
Task RunScheduledOptimisation(CancellationToken cancellationToken);
///
/// If supported this should perform any actions that are required on stopping the jellyfin server.
///
/// The token that will be used to abort the operation.
/// A representing the asynchronous operation.
Task RunShutdownTask(CancellationToken cancellationToken);
}