This repo is a small Next.js App Router project meant to showcase Drizzle ORM v1 beta 2 capabilities—especially end-to-end type-safety, clean schema definitions, and typed queries.
If you want the official release details, see the Drizzle docs: https://orm.drizzle.team/docs/latest-releases/drizzle-orm-v1beta2
Use commands below for quick run. See details in Development Guide
pnpm install
pnpm db:refresh
pnpm tsx src/scripts/playground.ts- Strongly typed schema in
src/lib/db/schema.ts - Typed DB client in
src/lib/db/client.ts - Type-safe queries that infer:
- column types
- select/insert shapes
- relations (if you add them)
- query results
- Simple reset + seed scripts to quickly iterate
src
├── lib
│ ├── config.ts
│ └── db
│ ├── client.ts
│ └── schema.ts
└── scripts
├── db
│ ├── reset.ts
│ └── seed.ts
└── playground.tsFollow the steps below to set up the project locally and explore the type-safe database features.
Copy the example environment configuration:
cp .env.example .envThen update the required variables (such as DATABASE_URL) if needed.
Initialize the database schema and seed data:
pnpm db:refreshThis command will:
- Reset the database
- Push the latest schema
- Seed the database with sample data
Open the Drizzle Studio UI to verify the tables and data:
pnpm db:studioThen open:
You should see the generated tables and seeded records.
Execute the example script to explore typed queries and experiment with the database:
pnpm tsx src/scripts/playground.tsThis script demonstrates how Drizzle ORM v1 beta 2 provides strong TypeScript typing for queries, inserts, and schema interactions.