aboutsummaryrefslogtreecommitdiff
path: root/src/Jellyfin.Database/Jellyfin.Database.Implementations/IJellyfinDatabaseProvider.cs
diff options
context:
space:
mode:
Diffstat (limited to 'src/Jellyfin.Database/Jellyfin.Database.Implementations/IJellyfinDatabaseProvider.cs')
-rw-r--r--src/Jellyfin.Database/Jellyfin.Database.Implementations/IJellyfinDatabaseProvider.cs24
1 files changed, 21 insertions, 3 deletions
diff --git a/src/Jellyfin.Database/Jellyfin.Database.Implementations/IJellyfinDatabaseProvider.cs b/src/Jellyfin.Database/Jellyfin.Database.Implementations/IJellyfinDatabaseProvider.cs
index 566b521dd..27dbeaba6 100644
--- a/src/Jellyfin.Database/Jellyfin.Database.Implementations/IJellyfinDatabaseProvider.cs
+++ b/src/Jellyfin.Database/Jellyfin.Database.Implementations/IJellyfinDatabaseProvider.cs
@@ -1,6 +1,8 @@
using System;
+using System.Collections.Generic;
using System.Threading;
using System.Threading.Tasks;
+using Jellyfin.Database.Implementations.DbConfiguration;
using Microsoft.EntityFrameworkCore;
namespace Jellyfin.Database.Implementations;
@@ -19,7 +21,8 @@ public interface IJellyfinDatabaseProvider
/// Initialises jellyfins EFCore database access.
/// </summary>
/// <param name="options">The EFCore database options.</param>
- void Initialise(DbContextOptionsBuilder options);
+ /// <param name="databaseConfiguration">The Jellyfin database options.</param>
+ void Initialise(DbContextOptionsBuilder options, DatabaseConfigurationOptions databaseConfiguration);
/// <summary>
/// Will be invoked when EFCore wants to build its model.
@@ -50,7 +53,7 @@ public interface IJellyfinDatabaseProvider
/// <summary>
/// Runs a full Database backup that can later be restored to.
/// </summary>
- /// <param name="cancellationToken">A cancelation token.</param>
+ /// <param name="cancellationToken">A cancellation token.</param>
/// <returns>A key to identify the backup.</returns>
/// <exception cref="NotImplementedException">May throw an NotImplementException if this operation is not supported for this database.</exception>
Task<string> MigrationBackupFast(CancellationToken cancellationToken);
@@ -59,7 +62,22 @@ public interface IJellyfinDatabaseProvider
/// Restores a backup that has been previously created by <see cref="MigrationBackupFast(CancellationToken)"/>.
/// </summary>
/// <param name="key">The key to the backup from which the current database should be restored from.</param>
- /// <param name="cancellationToken">A cancelation token.</param>
+ /// <param name="cancellationToken">A cancellation token.</param>
/// <returns>A <see cref="Task"/> representing the result of the asynchronous operation.</returns>
Task RestoreBackupFast(string key, CancellationToken cancellationToken);
+
+ /// <summary>
+ /// Deletes a backup that has been previously created by <see cref="MigrationBackupFast(CancellationToken)"/>.
+ /// </summary>
+ /// <param name="key">The key to the backup which should be cleaned up.</param>
+ /// <returns>A <see cref="Task"/> representing the result of the asynchronous operation.</returns>
+ Task DeleteBackup(string key);
+
+ /// <summary>
+ /// Removes all contents from the database.
+ /// </summary>
+ /// <param name="dbContext">The Database context.</param>
+ /// <param name="tableNames">The names of the tables to purge or null for all tables to be purged.</param>
+ /// <returns>A Task.</returns>
+ Task PurgeDatabase(JellyfinDbContext dbContext, IEnumerable<string>? tableNames);
}