Microdeck.tools 100 % en el navegador
Conversor de esquemas y código 100 % en tu navegador

Convertir PostgreSQL DDL a Drizzle ORM pgTable Online

Genera declaraciones pgTable idiomáticas de Drizzle ORM directamente a partir de consultas CREATE TABLE DDL de PostgreSQL.

SQL Dialect:
Target Output:
drizzle Output✓ Parsed 1 table (AST transpiler)
import { pgTable, serial, varchar, integer, boolean, timestamp } from "drizzle-orm/pg-core";

export const users = pgTable("users", {
  id: serial("id").primaryKey(),
  email: varchar("email", { length: 255 }).notNull().unique(),
  full_name: varchar("full_name", { length: 100 }),
  age: integer("age").default(18),
  is_active: boolean("is_active").default(true),
  created_at: timestamp("created_at").defaultNow(),
});

¿Te ahorró tiempo esta herramienta? Ayuda a mantener Microdeck gratis y al día. Opcional · Desde $3.

Ejemplo de conversión: PostgreSQL DDL → Drizzle pgTable

Entrada (PostgreSQL DDL)
CREATE TABLE orders (
  id SERIAL PRIMARY KEY,
  total_amount NUMERIC(10,2) NOT NULL
);
Salida (Drizzle pgTable)
import { pgTable, serial, numeric } from "drizzle-orm/pg-core";

export const orders = pgTable("orders", {
  id: serial("id").primaryKey(),
  totalAmount: numeric("total_amount", { precision: 10, scale: 2 }).notNull(),
});

Preguntas frecuentes (FAQ)

¿Puedo exportar tipos de TypeScript directamente desde Drizzle?

¡Sí! Drizzle incluye el tipo utilitario InferSelectModel<typeof tabla> para inferir y exportar los tipos exactos de tu base de datos.

Otras conversiones populares de bases de datos

Apoyar a Microdeck

Totalmente opcional · Desde $3 · Sin cuenta

Elige un importe (USD):Seleccionado:$5

El aporte mínimo es de $3 USD.

Totalmente opcional · Desde $3 · Pago seguro en Gumroad.