
Migrate To Sqlite
Migrate a TinyBase table to SQLite.
Install
npx skills add fastrepl/anarlog --skill migrate-to-sqlite -g -a claude-code -y- Repository
- fastrepl/anarlog9.7k
- Category
- Data and ML
- Updated
- 3d ago
- License
- MIT
- Context cost
- Mediumabout 2,036 tokens
- Runs scripts
- No, instructions only
What it does
Migrate a TinyBase table to SQLite. Use when asked to move a data domain (e.g. templates, vocabs) from the TinyBase store to the app SQLite database.
Status
Keep up to date as each PR lands. Outer box = fully done across both phases. Sub-bullets track sub-states where relevant.
This migration targets the TinyBase main store only. The separate
TinyBase settings store is out of scope unless the plan is explicitly
expanded to include it.
-
templates, already Drizzle, no Phase 0 needed -
calendars- Phase 0 reads (PR 2:
useCalendar,useEnabledCalendars) - Phase 0 writes,
services/calendar/ctx.tshas a cross-domain calendars+events transaction; lands with events PR - Phase 1, Rust migration + ops exist
- Phase 0 reads (PR 2:
-
events- Phase 0
- Phase 1, Rust migration + ops exist
-
sessions -
transcripts -
humans -
organizations -
enhanced_notes- Phase 0 reads,
session/hooks/useEnhancedNotes.ts - Phase 0 writes
- Phase 1
- Phase 0 reads,
-
mapping_session_participant -
mapping_tag_session -
mapping_mention -
tags -
chat_groups -
chat_messages -
session_key_facts -
tasks -
daily_notes- Phase 0 writes (partial),
chat/store/* - Phase 0 reads
- Phase 1
- Phase 0 writes (partial),
-
tasks -
memories- Phase 0 writes,
settings/memory/custom-vocabulary.tsx - Phase 0 reads
- Phase 1
- Phase 0 writes,
-
daily_notes
Strategy
Two-phase, per-domain migration. Each phase is many small PRs.
Phase 0, Decouple consumers
Before any storage swap, move every TinyBase call behind a domain hook
living in apps/desktop/src/<domain>/hooks.ts (or <domain>/hooks/*).
Hook return shapes are plain TypeScript; no TinyBase types leak out.
Consumer code stops importing ~/store/tinybase/store/main.
