Conversor Visual de SQL a Diagrama ER, Drizzle y Prisma

Haz ingeniería inversa de cualquier script SQL CREATE TABLE en segundos, reorganiza las relaciones visualmente y migra a Drizzle ORM o Prisma.

Plantillas:
customers4 cols
id
uuid
email
varchar
full_name
varchar
created_at
timestamp
products5 cols
id
uuid
sku
varchar
title
varchar
price
decimal
stock
int
orders5 cols
id
uuid
customer_id
uuid
status
varchar
total
decimal
created_at
timestamp
order_items5 cols
id
serial
order_id
uuid
product_id
uuid
quantity
int
unit_price
decimal
Arrastra las tablas para organizar el diagrama · Haz clic en una tabla para editar sus columnas
// Generated by SchemaCost — Drizzle ORM (PostgreSQL)
import { pgTable, uuid, varchar, timestamp, numeric, integer, bigserial } from 'drizzle-orm/pg-core';

export const customers = pgTable('customers', {
  id: uuid('id').primaryKey().defaultRandom(),
  email: varchar('email', { length: 255 }).notNull().unique(),
  fullName: varchar('full_name', { length: 255 }).notNull(),
  createdAt: timestamp('created_at', { withTimezone: true }).notNull().defaultNow(),
});

export const products = pgTable('products', {
  id: uuid('id').primaryKey().defaultRandom(),
  sku: varchar('sku', { length: 255 }).notNull().unique(),
  title: varchar('title', { length: 255 }).notNull(),
  price: numeric('price', { precision: 12, scale: 2 }).notNull(),
  stock: integer('stock').notNull(),
});

export const orders = pgTable('orders', {
  id: uuid('id').primaryKey().defaultRandom(),
  customerId: uuid('customer_id').notNull().references(() => customers.id, { onDelete: 'restrict' }),
  status: varchar('status', { length: 255 }).notNull(),
  total: numeric('total', { precision: 12, scale: 2 }).notNull(),
  createdAt: timestamp('created_at', { withTimezone: true }).notNull().defaultNow(),
});

export const orderItems = pgTable('order_items', {
  id: bigserial('id', { mode: 'number' }).primaryKey(),
  orderId: uuid('order_id').notNull().references(() => orders.id, { onDelete: 'cascade' }),
  productId: uuid('product_id').notNull().references(() => products.id, { onDelete: 'restrict' }),
  quantity: integer('quantity').notNull(),
  unitPrice: numeric('unit_price', { precision: 12, scale: 2 }).notNull(),
});

Ventajas clave

  • ✓ Parser local 100% privado: tus esquemas propietarios nunca salen del navegador.
  • ✓ Detecta llaves primarias, restricciones UNIQUE, NOT NULL y referencias FOREIGN KEY.

Preguntas frecuentes

¿Se envía mi código SQL a algún servidor externo?

No. Tanto el parser SQL como los generadores de código y el empaquetador ZIP se ejecutan 100% en tu navegador.