Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Storage, migration, hashes and ordering

The SQLite database behind NotesCore, schema migration, content hashes, sort keys and sample data. Decisions: D-09, D-27.

BehaviorShared
Data survives closing and reopening the databaseNotesCoreTest.dataSurvivesRestart
A version 1 database migrates and keeps typed titlesOrganizingTest.versionOneDatabasesMigrateAndKeepTypedTitles
SHA-256 matches known test vectorsDomainSupportTest.sha256KnownVectors
The content hash covers all state that a restore must bring backDomainSupportTest.contentHashCoversRecoverableState
Sort keys always fit between two neighbors and stay shortDomainSupportTest.sortKeysOrder
Sample notes seed the same data every timeNotesCoreTest.sampleNotesSeedTheSameDataEveryTime
A write against an outdated revision fails as staleNotesCoreTest.taskToggleCreatesRevisionAndRejectsStaleState, NotesCoreTest.moveDeleteUndelete

The platform databases (Android SQLite, iOS native driver) are exercised by the integration tests in export-import.md and by every UI test, but always in memory.

Gaps

  • Migrations are tested only from version 1. Add a test for each new schema version.
  • The on-disk database on a device is never tested; UI tests use an in-memory database. Upgrading an installed app is checked by hand (see docs/pending.md).
  • Two writes at once (for example autosave racing a task toggle) are untested.
  • iOS backup exclusion (D-11) and Android backup rules (D-10) are untested.