Melon-dbMelon-db

Roadmap

Phase-by-phase implementation history, shipped status, and deferred work.

This page is the living status for Melon-db. Update it when features land or deferrals change. For product vision see About Melon-db. For requirement-by-requirement PRD tracking see PRD compliance.

Status summary

AreaCount / status
Packages12 under packages/* (core through sync-server + native)
Example apps5 — playground-node, playground-rn, playground-rn-dev, playground-web, docs
Implementation phases0–34 shipped (see chronology below)
Out-of-cycleFumadocs docs site, TypeDoc API, playgrounds (ongoing maintenance)
NextPhase 35+ feature work; Phase 34 shipped release engineering

Quick links: Architecture · Phase ADRs · Packages · Performance


Phase chronology

Each phase was executed as a focused delivery increment. Phases 0–7 established the core stack; Phases 8–19 expanded RN, sync, and migration tooling; Phases 20–26 delivered native SQLite performance.

Foundation (Phases 0–7 + hardening)

PhaseTitlePackagesKey deliverablesStatus
0Monorepo bootstrapworkspaceBun workspaces, tooling, @melon-db/db skeletonShipped
1@melon-db/db M0@melon-db/dbSchema, AST, adapter types, query pipeline stubsShipped
2@melon-db/db M1@melon-db/dbIn-memory adapter, CRUD, serialized write queueShipped
3@melon-db/db M2@melon-db/dbChangeEmitter, observe, collection subscriptionsShipped
4@melon-db/db-sqlite M0@melon-db/db-sqliteAST → SQL compiler, predicate testsShipped
5@melon-db/db-sqlite M1@melon-db/db-sqliteBun SQLite adapter, DDL, integration testsShipped
6Planned M2/M3—RN native + perf milestones from db-core RFCSuperseded by Phases 8–10, 20–26
7Downstream packagesquery, react, mango, prisma, devtools, testkitFluent/Mango/Prisma surfaces, hooks, testkitShipped
—Hardening (post-7)CI, playground-nodeGitHub Actions, adapter CRUD vectors, initial benchmarks, devtools SQL snapshotsShipped

React Native and API (Phases 8–10)

PhaseTitlePackagesKey deliverablesStatus
8RN / Expo integration@melon-db/db-sqlite, @melon-db/db-reactexpo-sqlite adapter, SQLite change notifications, playground-rnShipped
9API completenessdb, react, prismauseFindMany/useMangoQuery, migrations, belongsTo includes, Prisma CLIShipped
10Perf & hardening@melon-db/db-sqliteSQL test coverage, debug flag, 10k/50k/100k benchmarks, Node driverShipped

Migration tooling (Phases 11, 19)

PhaseTitlePackagesKey deliverablesStatus
11Codemods v1@melon-db/db-codemodsQuery translator, migrate-queries/writes/react CLIShipped
19Codemods v2@melon-db/db-codemodsNested Q.and/or, fetch/observe handles, delete, migrate-schema spike, Q.on recipesShipped

Sync (Phases 12–18)

PhaseTitlePackagesKey deliverablesStatus
12Sync foundation@melon-db/db, @melon-db/syncOutbox, getLocalChanges/applyRemoteChanges, synchronize() alphaShipped
13Sync integrationsync, sync-server, reactPersistent checkpoints, HTTP server, useSync/useSyncStatus, RN sync demoShipped
14Devtools + docs sitedevtools, docsReactive bridge, inspector panel, Fumadocs + TanStack Start, CRUD/sync playgroundsShipped
15Sync reliabilitysync, dbRetry/cancellation, network monitor, conflict policies, migration-aware syncShipped
16Postgres backend@melon-db/sync-serverPostgresSyncStore, SQL migrations, Docker composeShipped
17Merge-by-field@melon-db/db, syncpendingFields outbox, field-level merge on applyShipped
18Custom conflict resolver@melon-db/db, sync, reactconflictPolicy: 'custom' + conflictResolver hookShipped

Native SQLite performance (Phases 20–26)

PhaseTitlePackagesKey deliverablesStatus
20Native SQLite spike@melon-db/db-sqlite-native, /rniOS bridge module, native driver factory, initial spikeShipped
21Android + hardeningnative, playground-rn-devReal Android SQLite, iOS busy timeout/basePath, dev build app splitShipped
22TurboModule (iOS)nativeCodegen MelonSQLiteSpec, iOS TurboModuleShipped
23TurboModule (Android)nativeAndroid codegen parity with iOSShipped
24WDB benchmarks@melon-db/db-sqlite, docsbench:compare, CI bench-compare, performance comparison docsShipped
25C++ JSI (iOS)nativeMelonSQLiteHostObject, native DB thread, global.melonSqliteJsiShipped
26C++ JSI (Android)nativeNDK/JNI, libmelon_sqlite, Android worker thread parityShipped
27Native observeQuery@melon-db/db-sqlitePredicate-aware invalidation, SQLite triggers foundation, reactiveSubscriptions: trueShipped
28RN on-device benchmarks@melon-db/db-sqlite/bench, playground-rn-devDev benchmark screen, jsi-sync vs turbo JSON report, shared scenario libShipped
29Trigger-driven observation@melon-db/db-sqlite, @melon-db/db-sqlite-nativeProcess _melon_observation_events, flushObservationQueue, native sqlite3_update_hook on JSIShipped
30Query + React DX@melon-db/db, @melon-db/db-query, @melon-db/db-reactcollection.query(builder), findMany/count builder input, QueryBuilder.not(), useRecord, *State hooks, ADR-010Shipped
31PRD compliance + DXdocs, devtools, playground-webprd-4 matrix, walkthroughs, devtools Plan/SQL params, AGENTS.md + melon-dev skill, typing passShipped
32Query engine — relations@melon-db/db, @melon-db/db-sqlite, codemodshasMany includes (post-fetch), relationFilters / Q.on via SQL IN subquery, Prisma include parityShipped
33observeQuery precision@melon-db/db, @melon-db/db-sqliteCross-collection relationFilters invalidation, field-aware updates, trigger delete fix, schema-aware subscription fingerprintShipped
34Alpha / open-source releaseall publishable packagesPublishable tarballs, CI smoke from packed tarballs, release workflow + docs/support policyShipped

Out-of-cycle: Documentation

PhaseTitlePackagesKey deliverablesStatus
—Fumadocs + docs siteapps/docsMDX guides, 12 package pages, TypeDoc API, search, live playgroundsShipped
—Docs expansion (this cycle)docsAbout/vision, phase history, architecture ADRs, package-scoped API titlesShipped

Shipped at a glance

Core engine, all three query surfaces, React/sync hooks, devtools, codemods, full sync stack (HTTP + Postgres), dual RN SQLite paths (Expo + native JSI on iOS/Android), predicate-aware observeQuery with trigger-event processing and JSI update_hook, Node + on-device benchmark harnesses, and CI (test, typecheck, biome, bench-smoke, bench-compare, postgres-sync, docs build).


Deferred (Phase 34+)

See PRD compliance — Phase 29+ decisions for rationale.

AreaNotes
EAS Build CIRelease automation for dev client artifacts
Full multi-file schema codemodsBeyond single-model migrate-schema spike
Background sync serviceOS-level scheduling
Per-field timestamps / three-way mergeAdvanced conflict resolution
SQL SELECT JOIN result shapingIncludes use post-fetch; capabilities.joins stays false
getChangedCollections on adaptersSync uses outbox today
Sync merging stateApply is synchronous in v1
playground-web SQLiteIn-memory Vite app shipped; web SQLite adapter still deferred
Sliding window (prd-4)Org-aware retention, prune ledger, pressure modes — see prd-4.mdc
Alpha / open-source releasenpm @melon-db org, public GitHub, LICENSE/SECURITY, publish CI — see PRD compliance — Alpha release

v1 limitations

  • All mutations must run inside db.write().
  • SQLite migrations: add-column and create-table only.
  • Relation includes: belongsTo + hasMany via post-fetch (not SQL JOIN); nested includes and per-parent take deferred.
  • Q.on / relationFilters: belongsTo only; experimental Watermelon join tables unsupported.
  • observeQuery: field-aware invalidation for WHERE + relationFilters + orderBy; orderBy+limit top-N membership may still over-invalidate in edge cases; in-memory adapter uses collection-wide ChangeEmitter fallback.

Package milestones

Per-package M0–M2 goals from the monorepo RFCs are reflected in the phase history above. Each package page lists alpha vs shipped status and setup examples.