跳到正文
文章入门

用 Prisma ORM 查询 D1

从零搭建并部署一个通过 Prisma ORM 查询 D1 数据库的 Cloudflare Worker,涵盖建表到本地运行。

最近更新
2026年10月12日
阅读原文

该介绍目前仅提供英文版本。

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.

继续学习