This example shows how to use Drizzle ORM with Prisma Postgres.
Clone this repository and download this template:
npx try-prisma@latest --template databases/drizzle-prisma-postgresThen navigate into the project directory and install dependencies:
cd drizzle-prisma-postgres
npm installRun the following command to create a Prisma Postgres database:
npx create-db@latestCopy the DATABASE_URL from the output and add it to a .env file:
DATABASE_URL="postgresql://..."Tip: Claim your database at the provided URL to keep it permanently.
npm run devThe script will:
- create
usersandpoststables (if they do not exist) - create a user with a post
- query all published posts and include each author
- update one post title