Melon-dbMelon-db

Getting started

Install Melon-db and run your first local database.

Melon-db is an offline-first local database for React Native and TypeScript — a modern successor to WatermelonDB.

Install

Install from npm (alpha)

Melon-db publishes alpha builds under the alpha dist-tag.

npm install @melon-db/db@alpha @melon-db/db-sqlite@alpha @melon-db/db-react@alpha

Or with Bun:

bun add @melon-db/db@alpha @melon-db/db-sqlite@alpha @melon-db/db-react@alpha

For Node/Bun SQLite, @melon-db/db-sqlite uses bun:sqlite by default. For React Native native JSI, install @melon-db/db-sqlite-native@alpha and follow the RN walkthrough.

Install from this monorepo

From the monorepo root:

bun install
bun test

In-memory quick start

import { createDatabase, createInMemoryAdapter, createMelonSchema } from '@melon-db/db';

const schema = createMelonSchema({
  version: 1,
  collections: {
    tasks: {
      name: 'tasks',
      primaryKey: 'id',
      fields: { id: { kind: 'string' }, title: { kind: 'string' } },
    },
  },
});

const db = createDatabase({ schema, adapter: createInMemoryAdapter() });

await db.write(async (tx) => {
  await tx.collection('tasks').insert({ id: '1', title: 'Hello' });
});

Follow the Local-first walkthrough for a full checklist.

SQLite (Bun / Node)

bun run demo

See Node and Bun walkthrough and apps/playground-node/README.md.

Web (browser)

bun run dev:web

Or use the CRUD playground in the docs site. See Web walkthrough.

React Native / Expo

Expo Go (default):

bun run dev:rn

See React Native (Expo) walkthrough.

Development build (JSI native SQLite):

bun run dev:rn:dev
bun run dev:rn:dev:start

See React Native (JSI) walkthrough.

Walkthroughs

GuideTopic
Walkthroughs indexAll guides
Full-stack syncHTTP + Postgres backends
Query surfacesFluent, Mango, Prisma-style
Devtools tourPlan, SQL, AST inspector

Setup and usage docs

  • Setup — schema, models, migrations, adapters
  • Usage — CRUD, queries, React hooks, writers
  • Sync — pull/push, backend contract, FAQ

Sync quick commands

bun run demo:sync
bun run sync-server

See Full-stack sync walkthrough.

Devtools

import { createReactiveDevtoolsBridge } from '@melon-db/db-devtools';

const devtools = createReactiveDevtoolsBridge();
const db = createDatabase({ schema, adapter, devtools });

Try the CRUD playground or Devtools tour.

Author & license

Copyright (c) 2026 Nate Nichols. Melon-db is MIT licensed. Alpha support expectations: Alpha support policy.