Skip to content

Instantly share code, notes, and snippets.

@PaulieScanlon
Created May 17, 2024 21:27
Show Gist options
  • Save PaulieScanlon/2cee08be2f2835d3da9f5db47ed75eda to your computer and use it in GitHub Desktop.
Save PaulieScanlon/2cee08be2f2835d3da9f5db47ed75eda to your computer and use it in GitHub Desktop.
Example of Drizzle ORM create table
import { pgTable, serial, varchar } from 'drizzle-orm/pg-core';
export const users = pgTable('users', {
user_id: serial('user_id').primaryKey(),
first_name: varchar('first_name', { length: 100 }),
last_name: varchar('last_name', { length: 100 }),
email: varchar('email', { length: 80 }).unique(),
role: varchar('role', { length: 20 }),
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment