Skip to content

docs: move the Prisma tutorial to Prisma ORM 8 and Prisma Postgres - #3505

Open
ankur-arch wants to merge 2 commits into
denoland:mainfrom
ankur-arch:docs/prisma-tutorial-prisma-postgres
Open

ankur-arch wants to merge 2 commits into
denoland:mainfrom
ankur-arch:docs/prisma-tutorial-prisma-postgres

Conversation

@ankur-arch

@ankur-arch ankur-arch commented Nov 3, 2026 •

Copy link
Copy Markdown

Rewrites examples/tutorials/prisma.md, which no longer works as written, for Prisma ORM 8:

  • npx prisma@latest init now runs the Prisma ORM 8 CLI, which has no init --generator-provider, db push or generate commands, and new PrismaClient({ datasourceUrl }) was removed in Prisma 7. The page now follows the ORM 8 flow: orm init run through Deno, a contract file, deno task contract:emit and deno task db:init, and the ORM 8 query API (db.orm.public.Dinosaur.all(), .where({ id }).first(), .create(), .delete()) in the seed script and the Oak routes.
  • The project starts with a deno.json (nodeModulesDir: "auto") and a package.json. orm init detects Deno from deno.json and installs with deno add; the CLI scripts live in package.json and run through deno task, which puts node_modules/.bin on the path. The page says why: deno run npm:prisma without a version resolves to the Prisma 7 CLI, which cannot read the ORM 8 config.
  • --minimum-dependency-age=0 is on the orm init command, with the reason: Deno 2.9 skips npm versions published in the last 24 hours, and Prisma ORM 8 release candidates ship often.
  • The database step uses create-db, which gives a free Prisma Postgres database without an account and writes DATABASE_URL to .env, and still says any PostgreSQL connection string works.
  • The "Setup Accelerate" section and the two Prisma Studio screenshots are removed; the remaining API screenshot still matches the output. Also fixes the localhost:8000/dinosaurs typo (the route is /dinosaur) and the Deno Deploy link at the end, which redirected.

The process.env usage from #2615 is kept (src/prisma/db.ts reads it through dotenv).

Tested end to end on Deno 2.9.8 with prisma 8.0.0-rc.30 and @prisma/orm-postgres 8.0.0-rc.22 against a Prisma Postgres database, running the page's commands and code blocks in order on a fresh directory: orm init, create-db, contract:emit, db:init, the seed script (3 rows), then main.ts with GET /dinosaur, POST /dinosaur, GET /dinosaur/4 and DELETE /dinosaur/4.

deno fmt --check, deno task check:freshness and deno test -A frontmatter_test.ts pass.

Disclosure: I work at Prisma.

The tutorial ran prisma@latest, which is now a Prisma ORM 8 pre-release
with a different CLI, and created PrismaClient with datasourceUrl, which
Prisma ORM 7 no longer accepts. Pin the CLI to 7, connect through
@prisma/adapter-pg, create the database with create-db instead of
pointing readers at a third-party signup, and drop the outdated
Accelerate step.
Replaces the Prisma 7 pin with the Prisma ORM 8 setup: orm init with Deno,
a contract file, deno task scripts for contract emit and db init, and the
ORM 8 query API in the seed script and the Oak routes. Drops the Prisma
Studio screenshots the page no longer uses.
@ankur-arch ankur-arch changed the title docs: fix the Prisma tutorial for Prisma ORM 7 and use Prisma Postgres docs: move the Prisma tutorial to Prisma ORM 8 and Prisma Postgres Nov 4, 2026
@ankur-arch

Copy link
Copy Markdown
Author

@thisisjofrank could you take a look when you have a moment? CI is green and every step on the page was run end to end on Deno 2.9.8. Happy to adjust anything.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant