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@alphaOr with Bun:
bun add @melon-db/db@alpha @melon-db/db-sqlite@alpha @melon-db/db-react@alphaFor 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 testIn-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 demoSee Node and Bun walkthrough and apps/playground-node/README.md.
Web (browser)
bun run dev:webOr use the CRUD playground in the docs site. See Web walkthrough.
React Native / Expo
Expo Go (default):
bun run dev:rnSee React Native (Expo) walkthrough.
Development build (JSI native SQLite):
bun run dev:rn:dev
bun run dev:rn:dev:startSee React Native (JSI) walkthrough.
Walkthroughs
| Guide | Topic |
|---|---|
| Walkthroughs index | All guides |
| Full-stack sync | HTTP + Postgres backends |
| Query surfaces | Fluent, Mango, Prisma-style |
| Devtools tour | Plan, 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-serverSee 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.
