Skip to main content

Data storage

Purpose

Documents where local durable state lives conceptually: SQLite databases, blob paths, and settings—not every table name.

Code location

  • Abstraction: IStorageProvider (Core) / SqliteStorageProvider (Infrastructure)
  • Typical consumers: Mnemo.Infrastructure/Services/Notes, flashcard services, vector store, statistics, settings

Main interfaces / classes

InterfaceResponsibility
IStorageProviderConnection/path abstraction for SQLite-backed features
ISettingsServiceKey/value application settings
INoteService / folder servicesNote graph atop storage

Inspect Mnemo.Infrastructure for concrete paths and migration hooks when you change schema.

Startup / registration flow

SqliteStorageProvider registers as a singleton in Bootstrapper before modules; services depending on storage resolve after provider build.

How to extend

  1. Prefer schema migrations co-located with the service that owns the table set—avoid ad hoc Ensure* scattered unless pattern already established.
  2. New export formats go through import/export coordinators (IContentFormatAdapter, package handlers) rather than raw file pokes from UI.

Gotchas

  • Long migrations on main thread freeze UI—follow async patterns and existing background seeds (Task.Run fire-and-forget only when explicitly intentional).
  • Backups: document user-facing backup paths per installer when shipping docs for compliance.

Related: Infrastructure