SchemaSnap
Free forever

CSV to Drizzle Schema

Drizzle defines tables as plain TypeScript objects: pgTable(name, { columns }), with each column built from a typed helper function like integer(), varchar(), or timestamp(), chained with .primaryKey() or .notNull().

SchemaSnap emits that structure directly from your CSV: the inferred type picks the right Drizzle column helper, the primary key gets .primaryKey(), and any column that never had a blank value in your sample gets .notNull().

Example

Run on a small sample CSV at build time, so this is real output, not a mockup.

Table structure (Postgres baseline)

CREATE TABLE customers (
  id SERIAL PRIMARY KEY,
  name VARCHAR(32) NOT NULL,
  email VARCHAR(32) NOT NULL,
  plan VARCHAR(32) NOT NULL,
  price NUMERIC(10,2) NOT NULL,
  signup_date DATE NOT NULL
);

Generated Drizzle schema

export const customers = pgTable('customers', {
  id: integer('id').primaryKey(),
  name: varchar('name').notNull(),
  email: varchar('email').notNull(),
  plan: varchar('plan').notNull(),
  price: numeric('price').notNull(),
  signup_date: date('signup_date').notNull()
});

Try it

Drop a .csv file here, or click to choose one. Or just paste below.

Outputs

Paste or drop a CSV, then hit Convert. Nothing you enter here leaves your browser.