La tappa E1 della 0.3.0 prepara il database per le copie esterne senza cambiare comportamento: nulla in interfaccia, motore o API usa ancora ciò che segue. - Migrazione 0003: export_destination, export_account, export_copy, export_run, export_item, video_analysis e media_conversion (risposta di Alberto del 26 novembre: i convertiti per la libreria in una tabella a parte, media non cambia), con i vincoli e gli indici di §8.3. - Archivi IExportStore, IVideoAnalysisStore e IMediaConversionStore in IFebeStorage; ExportSettings sulle cinque chiavi esportazione.*. - AccountStore.DeleteAsync spegne «Automatica» delle cartelle dell'account e vi scrive il suo nome prima di cancellarlo (finché non ci sono destinazioni non fa nulla). - Prove: aggiornamento dei database delle versioni 1 e 2 con foreign_key_check pulito, database più nuovo rifiutato e lasciato intatto, vincoli, archivi, piani delle ricerche, impostazioni e documenti. - SPECIFICA §4.10, §8.3 e §15, decisioni.md e stato.md aggiornati. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
65 lines
1.8 KiB
C#
65 lines
1.8 KiB
C#
namespace Febe.Core.Storage;
|
|
|
|
/// <summary>
|
|
/// Everything Febe keeps in its database, as one object (implemented by <c>Febe.Data.FebeDatabase</c>).
|
|
/// Writes are serialized by a single writer; reads run concurrently.
|
|
/// </summary>
|
|
public interface IFebeStorage : IAsyncDisposable
|
|
{
|
|
IAccountStore Accounts { get; }
|
|
|
|
IEntryStore Entries { get; }
|
|
|
|
IMediaStore Media { get; }
|
|
|
|
IHighlightStore Highlights { get; }
|
|
|
|
IDuplicateStore Duplicates { get; }
|
|
|
|
ITaskStore Tasks { get; }
|
|
|
|
IActionLogStore ActionLog { get; }
|
|
|
|
ISessionStore Sessions { get; }
|
|
|
|
IIncidentStore Incidents { get; }
|
|
|
|
IEventStore Events { get; }
|
|
|
|
IFollowingStore Following { get; }
|
|
|
|
IImportStore Imports { get; }
|
|
|
|
IExportStore Exports { get; }
|
|
|
|
IVideoAnalysisStore VideoAnalyses { get; }
|
|
|
|
IMediaConversionStore Conversions { get; }
|
|
|
|
ISettingsStore Settings { get; }
|
|
|
|
IDatabaseMaintenance Maintenance { get; }
|
|
}
|
|
|
|
/// <summary>Maintenance of the database file.</summary>
|
|
public interface IDatabaseMaintenance
|
|
{
|
|
/// <summary>Full path of the database file.</summary>
|
|
string DatabasePath { get; }
|
|
|
|
/// <summary>Schema version (PRAGMA user_version).</summary>
|
|
int SchemaVersion { get; }
|
|
|
|
/// <summary>
|
|
/// Writes a consistent copy of the database to a new file with <c>VACUUM INTO</c> (spec §8.5).
|
|
/// The destination must not exist.
|
|
/// </summary>
|
|
Task BackupToAsync(string destinationFile, CancellationToken ct = default);
|
|
|
|
/// <summary>Runs <c>PRAGMA quick_check</c>; true when the database is sound.</summary>
|
|
Task<bool> CheckIntegrityAsync(CancellationToken ct = default);
|
|
|
|
/// <summary>Lets SQLite refresh its statistics (<c>PRAGMA optimize</c>).</summary>
|
|
Task OptimizeAsync(CancellationToken ct = default);
|
|
}
|