Drizzle ORM Type Reference
Quick lookup table for Drizzle column builders, their SQL equivalents, and inferred TypeScript types — across PostgreSQL, MySQL, and SQLite. Click any Drizzle method to copy it.
Import from drizzle-orm/pg-core · 25 of 25 shown
| Type | Drizzle method | SQL equivalent | TypeScript type |
|---|---|---|---|
integer | INTEGER | number | |
smallint | SMALLINT | number | |
bigint mode: "bigint" yields bigint | BIGINT | number | bigint | |
serial Auto-increment primary key | SERIAL | number | |
bigserial | BIGSERIAL | number | bigint | |
smallserial | SMALLSERIAL | number | |
numeric Returned as string to preserve precision | NUMERIC(p,s) | string | |
decimal | DECIMAL(p,s) | string | |
real | REAL | number | |
doublePrecision | DOUBLE PRECISION | number | |
boolean | BOOLEAN | boolean | |
text | TEXT | string | |
varchar | VARCHAR(n) | string | |
char | CHAR(n) | string | |
uuid | UUID | string | |
date Use mode: "date" for JS Date | DATE | string | |
time | TIME | string | |
timestamp | TIMESTAMP | Date | |
timestamp w/ tz | TIMESTAMPTZ | Date | |
interval | INTERVAL | string | |
json | JSON | unknown (typed via $type) | |
jsonb | JSONB | unknown (typed via $type) | |
bytea | BYTEA | Buffer | |
pgEnum Declared outside pgTable | CREATE TYPE ... AS ENUM | union of literals | |
array | INTEGER[] | number[] |
How to read this table
- Type — short name of the Drizzle column type, including variants like
integer (timestamp)for SQLite mode options. - Drizzle method — the exact call you write inside
pgTable/mysqlTable/sqliteTable. Click it to copy. - SQL equivalent — what
drizzle-kitemits in your migration files. - TypeScript type — what
InferSelectModelinfers for that column by default.
Tips
- For
json/jsonbcolumns, use.$type<Shape>()to get a typed payload instead ofunknown. numeric/decimalreturn strings in JS — Drizzle avoids silent float rounding.- SQLite has no native boolean, date, or JSON types —
integerandtextwithmodehandle them.