Skip to content
ArticleBeginner

Query D1 using Prisma ORM

Set up and deploy a Cloudflare Worker that queries a D1 database with Prisma ORM, from creating the table to running locally.

Last updated
Oct 12, 2026
Read the original

Prisma ORM brings an intuitive data model, migrations, type safety and auto-completion to D1. This tutorial builds a Worker that queries D1 through Prisma from scratch.

What you’ll learn

  • Initialize Prisma ORM in a Worker
  • Create a D1 database and a table
  • Query the database from the Worker
  • Run locally and deploy

Cloudflare products used

D1, Workers.

Follow the full, step-by-step tutorial in Cloudflare’s documentation.

Keep learning