aboutsummaryrefslogtreecommitdiff
path: root/src/Jellyfin.Database/Jellyfin.Database.Implementations
diff options
context:
space:
mode:
authorJPVenson <github@jpb.email>2025-03-27 03:23:36 +0100
committerGitHub <noreply@github.com>2025-03-26 20:23:36 -0600
commit296b17bf44d39c116ad7c70aba8f8c144335fe24 (patch)
treed6626114816a7eb5efb6f9df3f96aaf3d373f1ac /src/Jellyfin.Database/Jellyfin.Database.Implementations
parent08dbb5c842e77f8a3e610fd8e339e4be570a1825 (diff)
Feature/backup on migration (#13754)
* Added generalised backup for migrations * Added backup strategy to MigrateLibraryDb * Added missing namespace * Fix merge issues * Fixed style issue * change fast backup key to timestamp * Update src/Jellyfin.Database/Jellyfin.Database.Providers.Sqlite/SqliteDatabaseProvider.cs * Update Fields * applied review comments
Diffstat (limited to 'src/Jellyfin.Database/Jellyfin.Database.Implementations')
-rw-r--r--src/Jellyfin.Database/Jellyfin.Database.Implementations/IJellyfinDatabaseProvider.cs17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/Jellyfin.Database/Jellyfin.Database.Implementations/IJellyfinDatabaseProvider.cs b/src/Jellyfin.Database/Jellyfin.Database.Implementations/IJellyfinDatabaseProvider.cs
index 074016553..566b521dd 100644
--- a/src/Jellyfin.Database/Jellyfin.Database.Implementations/IJellyfinDatabaseProvider.cs
+++ b/src/Jellyfin.Database/Jellyfin.Database.Implementations/IJellyfinDatabaseProvider.cs
@@ -1,3 +1,4 @@
+using System;
using System.Threading;
using System.Threading.Tasks;
using Microsoft.EntityFrameworkCore;
@@ -45,4 +46,20 @@ public interface IJellyfinDatabaseProvider
/// <param name="cancellationToken">The token that will be used to abort the operation.</param>
/// <returns>A <see cref="Task"/> representing the asynchronous operation.</returns>
Task RunShutdownTask(CancellationToken cancellationToken);
+
+ /// <summary>
+ /// Runs a full Database backup that can later be restored to.
+ /// </summary>
+ /// <param name="cancellationToken">A cancelation 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);
+
+ /// <summary>
+ /// 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>
+ /// <returns>A <see cref="Task"/> representing the result of the asynchronous operation.</returns>
+ Task RestoreBackupFast(string key, CancellationToken cancellationToken);
}