Skip to content

Latest commit

 

History

History

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 

README.md

Drizzle with Prisma Postgres

This example shows how to use Drizzle ORM with Prisma Postgres.

Getting started

1. Download the example and install dependencies

Clone this repository and download this template:

npx try-prisma@latest --template databases/drizzle-prisma-postgres

Then navigate into the project directory and install dependencies:

cd drizzle-prisma-postgres
npm install

2. Create a Prisma Postgres database

Run the following command to create a Prisma Postgres database:

npx create-db@latest

Copy 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.

3. Run the example

npm run dev

The script will:

  • create users and posts tables (if they do not exist)
  • create a user with a post
  • query all published posts and include each author
  • update one post title

Next steps