drizzle-team / drizzle-team/drizzle-orm

[FEATURE]: Feature Request: Support reverse syncing of schema changes from the database

Open
#4,915 0 comments 0 reactions 0 assignees View on GitHub
enhancement
Dominant language
TypeScript
Stars
35.8k
Forks
1.6k
Avg merge
2d 7h
Merged PRs (30d)
4

Description

### Feature hasn't been suggested before.

- [x] I have verified this feature I'm about to request hasn't been suggested before.

### Describe the enhancement you want to request

#### 📌 Context / Real-world Use Case

In real-world collaborative environments, it’s common for backend teams to make schema changes directly in the database — especially in legacy systems or teams migrating to Drizzle ORM.

- As a developer using Drizzle, We need to manually reflect these changes in `schema.ts`.
- Drizzle currently does not provide proper tooling to introspect or pull the current DB schema and generate Drizzle-compatible definitions.

#### 🧪 What I Tried

- Ran `drizzle-kit push` and `generate`, but Drizzle only looks at code changes and **does not detect new tables from the live database**.
- Even running `npx drizzle-kit studio` helped only with visualizing tables but not auto-generating schema files.
- Even there is `pull` command (like Prisma's `prisma db pull`) to generate schema from an existing database.

#### ❌ Current Behavior

- Drizzle completely ignores tables created or updated directly in the DB.
- Developer has to manually re-type Drizzle schema even if the DB is the source of truth.

#### ✅ Expected Behavior

- A CLI command like:

```bash
drizzle-kit introspect

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.