journal/Journal.Core/Services/IJournalDatabaseService.cs

30 lines
994 B
C#

namespace Journal.Core.Services;
public interface IJournalDatabaseService
{
string GetDatabasePath(string? dataDirectory = null);
byte[] DeriveDatabaseKey(string password);
string BuildPragmaKeyStatement(string password);
IReadOnlyDictionary<string, string> GetSchemaStatements();
string WriteSchemaBootstrap(string? dataDirectory = null);
JournalDatabaseStatus GetStatus(string password, string? dataDirectory = null);
JournalDatabaseHydrationResult HydrateWorkspace(string password, string? dataDirectory = null);
}
public sealed record JournalDatabaseStatus(
string DatabasePath,
int KeyLengthBytes,
int Iterations,
string KeyDerivation,
IReadOnlyList<string> SchemaTables,
string SchemaBootstrapPath,
bool RuntimeReady,
string RuntimeMessage);
public sealed record JournalDatabaseHydrationResult(
string DatabasePath,
string SchemaBootstrapPath,
int EntryFilesProcessed,
bool RuntimeReady,
string Message);