Prisma ORM 8 is here.Read the docs
Runtimes

Deno

Run a minimal Prisma ORM and PostgreSQL app on Deno.

Introduction

In this guide, you scaffold a minimal Prisma ORM app for Deno, initialize a PostgreSQL database, and run the generated typed query. The app uses Deno-native tasks and explicit .ts extensions for relative imports.

Every command below was run end to end against a live Prisma Postgres database.

Prerequisites

  • Deno 2.6 or later (deno --version): the scaffold command passes --minimum-dependency-age=0, which earlier releases reject

Use with your agent

To delegate this guide to your coding agent, copy the prompt below and hand it over:

Use with your agent
Use with your agent
Create and verify a minimal Prisma ORM app on Deno.

1. Run `deno run -A --minimum-dependency-age=0 npm:create-prisma@latest my-deno-app --template minimal --provider postgres --package-manager deno --no-deploy --yes`.
2. Enter `my-deno-app`. Run `deno run -A npm:create-db@latest --env .env --ttl 24h` and show me the claim URL so I can keep the temporary database.
3. Run `deno task db:init`, then start `deno task dev` in the background.
4. Request `http://localhost:3000` and verify that it returns Alice, Bob, and Carol. The first request seeds these users automatically; do not add or run a separate seed command.
5. Do not deploy to Prisma Compute because it does not support Deno.

Use the generated tasks instead of invoking a Prisma CLI package directly.

1. Scaffold the project

Run create-prisma through Deno and select the minimal PostgreSQL template:

deno run -A --minimum-dependency-age=0 npm:create-prisma@latest my-deno-app --template minimal --provider postgres --package-manager deno --no-deploy

The command creates the app, installs its npm dependencies through Deno, and emits the Prisma contract artifacts. Deno 2.9 skips npm packages published in the previous 24 hours by default, so without --minimum-dependency-age=0 a newly published create-prisma release resolves to an older version. Deno support is currently limited to the minimal PostgreSQL template.

cd my-deno-app

The generated project includes:

  • deno.json with npm compatibility enabled
  • Deno-native dev, build, and Prisma tasks in package.json
  • explicit .ts extensions on relative imports
  • no Composer or Prisma Compute deployment files

2. Create and initialize the database

Create a temporary Prisma Postgres database and write its connection string to .env:

deno run -A npm:create-db@latest --env .env --ttl 24h

The command prints a claim URL. Open it within 24 hours to keep the database, or replace DATABASE_URL in .env with your own PostgreSQL connection string.

Apply the starter contract and sign the database:

deno task db:init

3. Run the app

Start the generated HTTP server:

deno task dev

Then request it from another terminal:

curl http://localhost:3000

The response contains the starter users:

{
  "users": [
    { "id": "1", "email": "alice@prisma.io", "username": "alice", "name": "Alice", "createdAt": "2026-07-24T10:55:54.156Z" },
    { "id": "2", "email": "bob@prisma.io", "username": "bob", "name": "Bob", "createdAt": "2026-07-24T10:55:54.192Z" },
    { "id": "3", "email": "carol@prisma.io", "username": "carol", "name": "Carol", "createdAt": "2026-07-24T10:55:54.228Z" }
  ]
}

The first request runs src/prisma/seed.ts through the generated query helper. Seeding is idempotent, so later requests read the same rows without creating duplicates. There is no separate seed command.

4. Understand the generated query

The generated src/prisma/users.ts connects the database, seeds on the first query, and reads from the PostgreSQL public namespace:

src/prisma/users.ts
import { db } from "./db.ts";
import { seed } from "./seed.ts";

export async function listUsers(limit = 10) {
  await seed();

  const users = await db.orm.public.User
    .select("id", "email", "username", "name", "createdAt")
    .limit(limit)
    .all();

  return users.map((user) => ({
    id: String(user.id),
    email: user.email,
    username: user.username ?? null,
    name: user.name ?? null,
    createdAt: user.createdAt,
  }));
}

Deno requires the .ts extension on these relative imports. The generated files already include it.

After changing src/prisma/contract.prisma, regenerate the typed artifacts and update the database:

deno task contract:emit
deno task db:update

Current limitations

  • Prisma Compute does not support Deno deployments yet.
  • The generated commands use -A for the filesystem, environment, and network permissions required during setup and local development. You can replace it with a narrower allow list for your application after setup.

Next steps

On this page