feat(persistence): EF Core + SQLite persistence layer (#26)#32
Merged
Conversation
…#26) RED commit — stubs throw NotImplementedException; integration tests fail. Failing tests: - GivenAnAccountRepository: 4 tests - GivenASyncRuleRepository: 2 tests Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Add 13 strongly-typed domain value objects (AccountId, DriveId, EmailAddress, etc.) - Add 8 EF Core entities with IEntityTypeConfiguration, cascade deletes, and DateTimeOffset→ticks converters - Add AppDbContext with ApplyConfigurationsFromAssembly and InitialCreate migration - Add SqliteTypeConverters for all value objects and DateTimeOffset variants - Add 6 repository interfaces + implementations (Account, SyncRule, SyncedItem, DriveState, Sync, FileClassificationRule) - Add AppDbContextDesignTimeFactory for dotnet-ef tooling - Replace AccountOnboardingService in-memory stub with real IAccountRepository + ISyncRuleRepository persistence - Add BindAsync overload to ResultExtensions for async chaining without intermediate variables - Register IDbContextFactory<AppDbContext> (singleton) and all repositories (transient) in App.axaml.cs - Call Database.Migrate() on startup - Add integration test project with DatabaseFixture (MigrateAsync), 21 integration tests across Account, SyncRule, DriveState repositories and AccountOnboardingService Closes #26 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Test results0 tests 0 ✅ 0s ⏱️ Results for commit edf59ff. |
jbarden
approved these changes
May 27, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Implements the full EF Core + SQLite persistence layer described in issue #26. Accounts, sync rules, and all related state now survive app restarts.
Changes
Production
AccountId,DriveId,EmailAddress,LocalSyncPath, etc.) — allreadonly record struct(string Value)IEntityTypeConfiguration<T>, cascade deletes on all child tables, andDateTimeOffset→ticks converters for SQLite compatibilityAppDbContextwithApplyConfigurationsFromAssembly+InitialCreatemigrationSqliteTypeConverters— centralised value converters for all wrapper types andDateTimeOffsetvariantsAccountRepository,SyncRuleRepository,SyncedItemRepository,DriveStateRepository,SyncRepository,FileClassificationRuleRepositoryAppDbContextDesignTimeFactory— enablesdotnet eftoolingAccountOnboardingService— replaces the in-memory stub with realIAccountRepository+ISyncRuleRepositorypersistence; usesBindAsyncchain to stay compliant with no-is-matching ruleResultExtensions.BindAsync— new async-binder overload enablingTask<Result<T,E>>chaining without intermediate variablesApp.axaml.cs— registersIDbContextFactory<AppDbContext>(singleton), all 6 repos (transient), callsDatabase.Migrate()on startupTests
AStar.Dev.CloudSyncFunctional.Tests.Integration) with real SQLite:memory:viaIClassFixture<DatabaseFixture>andMigrateAsyncAccountRepository,SyncRuleRepository,DriveStateRepository, andAccountOnboardingService(end-to-end with real DB)Test plan
dotnet build— 0 errors, 0 warningsOptioncolumns (LastSyncedAt) round-trip correctly via nullable ticks converterAccountEntityremoves all child rowsMigrateAsyncruns on startup viaApp.axaml.csCloses #26
🤖 Generated with Claude Code