You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit e69a14c
Browse filesBrowse the repository at this point in the historyBrowse files
- Bumped version to 1.0.0
- Updated CLI format choices to include alembic (7 formats)
- Comprehensive README rewrite with type mapping table, IR architecture, full CLI examples
- Updated roadmap through v1.0.0
- 137/137 tests passing
**Why SchemaForge?** Every major ORM migration is a one-way street. Prisma can introspect SQL but can't export back. Drizzle users manually rewrite schemas when switching ORMs. TypeORM developers are locked into decorator syntax. No tool does bidirectional, lossless conversion between 5+ ORM formats — until now.
11
+
**Why SchemaForge?** Every major ORM migration is a one-way street. Prisma introspects SQL but can't export back. Drizzle users manually rewrite schemas when switching ORMs. TypeORM developers are locked into decorator syntax. SchemaForge is the first tool to do **bidirectional, lossless conversion** between 7 schema formats — with a shared internal representation that guarantees roundtrip fidelity.
11
12
12
-
SchemaForge fills this gap. Convert any schema to any format, verify equivalence with the diff command, and batch-process entire directories. Whether you're migrating from Prisma to Drizzle, sharing a schema with a Django backend, or generating SQL DDL from TypeORM entities, SchemaForge handles it with zero information loss.
13
+
Convert any schema to any format, verify equivalence with the diff command, generate Alembic migrations, and batch-process entire directories. Whether you're migrating from Prisma to Drizzle, sharing a schema with a Django backend, or generating SQL DDL from TypeORM entities — SchemaForge handles it.
Detects added, removed, and modified tables, columns, indexes, and constraints.
96
+
Detects added, removed, and modified tables, columns, indexes, and constraints. Useful for CI/CD checks and code review.
57
97
58
98
## Supported Formats
59
99
@@ -67,11 +107,56 @@ Detects added, removed, and modified tables, columns, indexes, and constraints.
67
107
| SQLAlchemy models | ✓ | ✓ | ✓ |
68
108
| Alembic migrations | — | ✓ | — |
69
109
110
+
**Alembic** is generator-only: you can create migration scripts from any format, but parsing existing migrations back to IR is not yet supported.
111
+
112
+
## How It Works
113
+
114
+
SchemaForge uses a **shared Internal Representation (IR)** — all formats convert to and from this common schema definition. This architecture guarantees:
115
+
116
+
-**Zero-loss roundtripping**: `sql → prisma → sql` produces the same schema you started with
117
+
-**Bidirectional conversion**: every supported format can convert to every other format
118
+
-**Extensibility**: adding a new format requires only a parser and a generator — no pairwise converters
119
+
120
+
```
121
+
SQL DDL ──┐
122
+
Prisma ───┤
123
+
Drizzle ──┤
124
+
TypeORM ──┼──▶ Shared IR ──▶ Any Format
125
+
Django ───┤
126
+
SQLAlchemy ──┤
127
+
Alembic ───┘
128
+
```
129
+
130
+
## Type Mapping
131
+
132
+
SchemaForge maps types intelligently between ORM systems. The core `ColumnType` enum represents all supported data types, and each format maps them to their native equivalents.
**Function defaults** (`CURRENT_TIMESTAMP`, `NOW()`, `gen_random_uuid()`, etc.) are preserved across conversions using a `fn:` prefix convention. For example, `DEFAULT CURRENT_TIMESTAMP` in SQL becomes `@default(now())` in Prisma and `server_default=func.now()` in SQLAlchemy.
151
+
70
152
## Demo Fixtures
71
153
72
-
Try SchemaForge immediately with our example blog schema. The `fixtures/` directory contains an equivalent schema (users, posts, categories with foreign keys, enums, and various data types) in6 supported formats:
154
+
Try SchemaForge immediately with our example blog schema. The `fixtures/` directory contains an equivalent schema (users, posts, categories with enums and various data types) in 7 formats:
0 commit comments