ORM Mapper
Visual object-relational mapper for designing database schemas with drag-and-drop.
Overview
FlowORM Mapper is a visual canvas where you design your data model by dragging entity boxes, defining fields and their types, and drawing relationship lines between entities. As you build, FlowORM generates SQL DDL and ORM model code in real time — ready to copy into your project. No raw schema editing required.
Runs Entirely in the Browser
FlowORM Mapper requires no database connection and sends no data to any server. Your schema is stored in local browser state and can be exported as a JSON canvas file for later re-import.
Drag-and-Drop Canvas
Add entity boxes by dragging from the palette or double-clicking the canvas. Reposition freely. Pan with middle-click, zoom with scroll wheel.
Relationship Editor
Draw one-to-one, one-to-many, and many-to-many relationships by connecting entity handles. Labels show the cardinality at each end.
Live Code Generation
Switch between TypeORM, Prisma, and Sequelize output. The code panel updates immediately as you modify the canvas — no export step needed.
Export Options
Export as PNG diagram, SVG vector, SQL DDL script, or JSON canvas snapshot that can be re-imported later.
Creating Entities
An entity maps to a database table. Each entity has a name and a list of fields (columns).
Adding an Entity
- Click the Add Entity button in the top toolbar, or double-click an empty area of the canvas.
- A new entity box appears with a default name. Click the name to rename it.
- Click + Field inside the entity box to add a column.
- For each field, set the name, data type (string, integer, boolean, date, UUID, text, decimal, json), and optional flags: Primary Key, Nullable, Unique, Default value.
Auto-generate Primary Key
Every new entity automatically includes an id field of type UUID set as the primary key. You can rename it or change its type to integer with auto-increment if your convention requires it.
Field Types Available
| Type | Maps To (PostgreSQL) | ORM Decorator |
|---|---|---|
| string | VARCHAR(255) | @Column({ type: 'varchar' }) |
| text | TEXT | @Column({ type: 'text' }) |
| integer | INTEGER | @Column({ type: 'int' }) |
| decimal | NUMERIC(10,2) | @Column({ type: 'decimal' }) |
| boolean | BOOLEAN | @Column({ type: 'boolean' }) |
| date | DATE | @Column({ type: 'date' }) |
| timestamp | TIMESTAMP | @Column({ type: 'timestamp' }) |
| uuid | UUID | @PrimaryGeneratedColumn('uuid') |
| json | JSONB | @Column({ type: 'jsonb' }) |
Defining Relationships
Relationships model how entities relate to each other and generate the correct foreign key columns and ORM association decorators.
Drawing a Relationship
- Hover over the source entity — a small connector circle appears on each edge.
- Click and drag from the connector circle to the target entity.
- A relationship line appears. Click it to select it.
- In the side panel, choose the relationship type: One-to-One, One-to-Many, or Many-to-Many.
- Set the owner side (which entity holds the foreign key column).
One-to-One
A single row in the source maps to exactly one row in the target. Generates a unique foreign key column on the owner entity.
One-to-Many
One row in the source maps to many rows in the target. The foreign key column is placed on the "many" side (target entity).
Many-to-Many
Rows in both entities can relate to multiple rows in the other. A junction table is automatically generated in the DDL and ORM output.
Code Generation
The code panel on the right side of the canvas shows the generated output for your chosen target. Switch targets with the dropdown in the toolbar — the canvas does not change, only the output format does.
Supported ORM Targets
| Target | Output Format | File Extension |
|---|---|---|
| TypeORM | TypeScript classes with @Entity, @Column, @OneToMany decorators | .entity.ts |
| Prisma | Prisma Schema Language model blocks with @@relation | schema.prisma |
| Sequelize | TypeScript model files using DataTypes and hasMany / belongsTo | .model.ts |
| SQL DDL | ANSI SQL CREATE TABLE statements with foreign key constraints | .sql |
Copying the Generated Code
Use the Copy button above the code panel to copy the entire output to your clipboard. For ORM targets with multiple entities, each entity's class or model block is separated by a blank line and a comment header for easy splitting.
Download Individual Files
Click Download in the code panel to save the output as a file. When using TypeORM or Sequelize, each entity is saved as a separate file in a zip archive to match standard project structure.
Export & Import
The JSON canvas export preserves the complete schema design including entity positions, field definitions, relationship types, and the currently selected ORM target. Use it to share diagrams with teammates or to resume work across sessions.
Export Formats
- JSON (Canvas) — re-importable snapshot of the entire canvas state.
- PNG — raster image with a transparent background, suitable for documentation.
- SVG — scalable vector diagram, best for presentations and wikis.
- SQL DDL —
CREATE TABLEstatements ready to run against a database. - ORM Code — the currently selected ORM target output, as a zip file per entity.
Canvas is Not Persisted Automatically
The canvas state is held in browser memory and is lost on page refresh unless you export a JSON snapshot first. Always export a JSON canvas file before closing the browser if you want to resume work later.
Tips
- Use Ctrl+Z / Cmd+Z to undo the last canvas action (add entity, add field, draw relationship, move entity).
- Hold Shift and click multiple entities to select them as a group and move them together.
- Use the Auto-Layout button in the toolbar to arrange entities into a clean grid when the canvas becomes cluttered.
- Hover over any relationship line to see a tooltip showing the full relation definition (owner, type, cascade rules).
- The Minimap (bottom-right corner) helps navigate large schemas — click a region in the minimap to jump there.
AI Assistant
Open the built-in AI Assistant from the tab on the right edge of the screen to get help with your entity schema and migrations. The assistant sees the current entity list, the active tab (Schema Inspector, Migration Log, or Query Preview), any pending schema diff, and the migration log, so you can ask things like:
- "Explain what will change when I run this pending migration"
- "Should I add an index on any of these columns?"
- "What's a safe way to add a NOT NULL column to a large table?"
- "Review my entity relationships for any modeling issues"
The assistant does not have a live database connection — it reasons over the schema and migration log shown on screen, not actual query results.
FAQ
CREATE TABLE statements. FlowORM parses the DDL, creates entity boxes for each table, and draws relationship lines for detected foreign key constraints. This is also the fastest way to visualise an existing schema — use the Schema Visualizer if you only need the diagram without editing.npx typeorm migration:generate -n MigrationName in your project after copying the entity files.