Forward Engineering

From diagram to production code

Forward engineering converts your visual schema into executable code. Relmic supports over 12 export formats — from raw SQL DDL to modern ORM schemas — all generated in a single click.

How to export

  1. Open the Export panel from the toolbar or sidebar.
  2. Choose a format from the tab bar (e.g., PostgreSQL, Prisma, TypeScript).
  3. Preview the generated code in the panel.
  4. Click Copy to copy to clipboard, or Download to save as a file.

The generated code always reflects your current schema. If you change a column type or add a relationship, the export updates immediately.

SQL DDL generation

Relmic generates native SQL DDL for all 8 supported DBMS. Each output uses the correct data types, syntax, and constraint style for the target system. The generated SQL includes CREATE TABLE statements, PRIMARY KEY and FOREIGN KEY constraints, indexes, and default values.

PostgreSQL

Uses native types like UUID, SERIAL, TIMESTAMPTZ, and TEXT. Generates CREATE TABLE with constraints and comments.

MySQL

Outputs ENGINE=InnoDB, uses AUTO_INCREMENT for serial columns, and DATETIME for timestamps.

MariaDB

Similar to MySQL output with MariaDB-specific features like UUID type and JSON support.

SQL Server

Uses NVARCHAR, UNIQUEIDENTIFIER, IDENTITY(1,1) and SQL Server-specific constraint syntax.

SQLite

Generates lightweight DDL with INTEGER PRIMARY KEY and AUTOINCREMENT. No ALTER TABLE for constraints.

Oracle

Outputs Oracle-specific types like NUMBER, VARCHAR2, and sequences for auto-increment columns.

BigQuery

Generates BigQuery-compatible DDL with STRUCT, ARRAY types and partitioning hints.

Redshift

Outputs Redshift DDL with distribution keys, sort keys, and ENCODE compression hints.

ORM schema exports

If your application uses an ORM, Relmic can generate schema files directly. This means you can design your database visually and get a ready-to-use ORM schema without writing it by hand.

Prisma Schema

.prisma

Generates a complete Prisma schema file with models, relations, and field attributes. Ready to use with prisma generate.

Drizzle ORM

.ts

Outputs Drizzle table definitions using pgTable, mysqlTable, or sqliteTable based on your DBMS. Includes relations and indexes.

SQLAlchemy

.py

Generates Python classes extending Base with Column definitions, ForeignKey constraints, and relationship declarations.

Type definition exports

For frontend and API development, Relmic exports type definitions that match your database schema. Use these to keep your application types in sync with your database structure.

TypeScript

.ts

Generates TypeScript interfaces matching your table structure. Each table becomes an interface with properly typed fields.

JSON Schema

.json

Outputs JSON Schema objects for each table with property types, required fields, format hints, and max lengths.

Image and PDF export

For documentation, presentations, and sharing, Relmic can export your schema as a high-resolution image or PDF.

  • PNG — available on all plans. Exports a rasterized image of the current canvas view.
  • PDF — available on Pro and above. Generates a multi-page PDF with table definitions and relationships.

Pro tip

Combine forward engineering with migration generation to evolve your schema safely. Design your changes visually, then export ALTER statements instead of rewriting your DDL from scratch.