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
Convert a schema from one format to another. All 11 formats support conversion to and from every other format (110 direction pairs).
58
+
Convert a schema from one format to another. Every format converts to and from every other format, except Alembic which is generator-only (a target, not a source) — 100 direction pairs.
59
59
60
60
```bash
61
61
# Format-specific examples
@@ -115,6 +115,11 @@ Detects added, removed, and modified tables, columns, indexes, and constraints.
115
115
116
116
**Alembic** is generator-only: you can create migration scripts from any format, but parsing existing migrations back to IR is not yet supported.
117
117
118
+
### Limitations
119
+
120
+
-**Foreign keys & relationships** — the shared IR does not yet model foreign-key constraints or ORM relations, so `FOREIGN KEY` / `REFERENCES` clauses, Prisma/TypeORM relation fields, and Django `ForeignKey` fields are dropped during conversion rather than roundtripped. Tables, columns, types, defaults, indexes, unique constraints, and enums are preserved. FK support is on the roadmap.
121
+
-**Alembic is generator-only** (see above) — you can generate migrations from any format but not parse them back.
122
+
118
123
### Format Identifiers for `--from` / `--to`
119
124
120
125
| CLI identifier | Format |
@@ -135,8 +140,8 @@ Detects added, removed, and modified tables, columns, indexes, and constraints.
135
140
136
141
SchemaForge uses a **shared Internal Representation (IR)** — all formats convert to and from this common schema definition. This architecture guarantees:
137
142
138
-
-**Zero-loss roundtripping**: `sql → prisma → sql`produces the same schema you started with
139
-
-**Bidirectional conversion**: every supported format can convert to every other format
143
+
-**High-fidelity roundtripping**: `sql → prisma → sql`reproduces tables, columns, types, defaults, indexes, unique constraints, and enums. Foreign-key/relationship constraints are not yet modeled in the IR and are dropped (see [Limitations](#limitations)).
144
+
-**Bidirectional conversion**: every format can convert to every other format, except Alembic, which is generator-only (a target, not a source)
140
145
-**Extensibility**: adding a new format requires only a parser and a generator — no pairwise converters
141
146
142
147
```
@@ -238,8 +243,8 @@ Each fixture demonstrates the same blog schema so you can compare ORM syntax sid
238
243
239
244
## Features
240
245
241
-
- **Bidirectional conversion** — all 11 formats convert to and from every other format
242
-
- **Zero-loss roundtripping** — `sql → prisma → sql` reproduces the original schema exactly
246
+
- **Bidirectional conversion** — every format converts to and from every other format (Alembic is generator-only: a target, not a source)
247
+
- **High-fidelity roundtripping** — `sql → prisma → sql` reproduces tables, columns, types, defaults, indexes, and enums (foreign keys are not yet preserved — see [Limitations](#limitations))
243
248
- **Custom type mappings** — YAML/JSON config files to override any type mapping with template variables
244
249
- **VS Code extension** — live preview, schema diff, and one-click conversion from VS Code
245
250
- **Alembic migration generation** — create database migration scripts from any schema format
@@ -253,7 +258,7 @@ Each fixture demonstrates the same blog schema so you can compare ORM syntax sid
- **Relation preservation** — indexes, unique constraints maintained across all conversions
261
+
- **Index & constraint preservation** — indexes and unique constraints maintained across all conversions (foreign-key/relationship constraints are not yet modeled — see [Limitations](#limitations))
257
262
- **Custom type handling** — dialect-specific types (JSONB, etc.) pass through via CUSTOM type
0 commit comments