namespace Febe.Core.Storage; /// /// Everything Febe keeps in its database, as one object (implemented by Febe.Data.FebeDatabase). /// Writes are serialized by a single writer; reads run concurrently. /// 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; } } /// Maintenance of the database file. public interface IDatabaseMaintenance { /// Full path of the database file. string DatabasePath { get; } /// Schema version (PRAGMA user_version). int SchemaVersion { get; } /// /// Writes a consistent copy of the database to a new file with VACUUM INTO (spec ยง8.5). /// The destination must not exist. /// Task BackupToAsync(string destinationFile, CancellationToken ct = default); /// Runs PRAGMA quick_check; true when the database is sound. Task CheckIntegrityAsync(CancellationToken ct = default); /// Lets SQLite refresh its statistics (PRAGMA optimize). Task OptimizeAsync(CancellationToken ct = default); }