diff --git a/apps/blog/content/blog/prisma-compute-generally-available/index.mdx b/apps/blog/content/blog/prisma-compute-generally-available/index.mdx index 2bba9192cc3..b54cb652f57 100644 --- a/apps/blog/content/blog/prisma-compute-generally-available/index.mdx +++ b/apps/blog/content/blog/prisma-compute-generally-available/index.mdx @@ -105,6 +105,7 @@ import { definePrismaConfig } from "prisma/config"; export default definePrismaConfig({ composer: composer({ + entry: "./module.ts", extensions: [prismaCloud({ region: "us-east-1" }), nodeBuild()], state: prismaState(), }), @@ -113,15 +114,15 @@ export default definePrismaConfig({ The module provisions a database and the API service and passes the database in as a dependency. `rawPostgres()` appears twice: with options in the module it creates the database, and bare in the service it declares what the service needs. -In the server, `service.load()` returns the database URL for whichever environment the code is running in. **The same file works on your laptop, in a preview, and in production without a connection string in any settings page**, and a dependency you forgot to wire is a type error. The `prisma.config.ts` file is read only by the CLI and names the extensions that deploy to Prisma and where deploy state is kept. +In the server, `service.load()` returns the database URL for whichever environment the code is running in. **The same file works on your laptop, in a preview, and in production without a connection string in any settings page**, and a dependency you forgot to wire is a type error. The `prisma.config.ts` file is read only by the CLI. Its `composer` section names the entry the CLI loads, `./module.ts`, along with the extensions that deploy to Prisma and where deploy state is kept. A build script such as `bun build src/api/server.ts --target=bun --outfile dist/api/server.mjs` produces the file the service points at. The `node` build adapter is for Node.js-style servers, and Compute runs the output on Bun, so an Express or Hono server is declared the same way and runs through Bun's Node.js compatibility. The `prisma` CLI you know from the ORM runs and deploys it, once the build has run: -- `npx prisma dev module.ts` runs the whole app on your machine against a local Postgres. -- `npx prisma deploy module.ts` provisions the real service and database, and running it again applies only what changed. -- `npx prisma deploy module.ts --stage ` deploys an isolated copy of the whole app, which is what the GitHub Action does for each preview branch. +- `npx prisma dev` runs the whole app on your machine against a local Postgres. +- `npx prisma deploy` provisions the real service and database, and running it again applies only what changed. +- `npx prisma deploy --environment ` deploys an isolated copy of the whole app. The GitHub Action does the same for each preview branch, with an environment named after the branch. The example uses `rawPostgres()`, which hands your server a connection URL for whatever client you already use and leaves migrations to you. If your schema is managed by Prisma ORM 8, declare the database with `postgres()` and the data contract the ORM compiles from your schema instead: the server gets a client typed by that schema, and each deploy applies your migrations, which is what gives every preview database your schema from the start. @@ -215,7 +216,7 @@ npm pkg set type=module npm pkg set scripts.build="bun build src/api/server.ts --target=bun --outfile dist/api/server.mjs" npx prisma auth login npm run build -npx prisma deploy module.ts +npx prisma deploy ``` With the `tsconfig.json` from the [Composer getting-started guide](https://www.prisma.io/docs/composer/getting-started), `typescript` and `@types/bun` let `npx tsc --noEmit` check the wiring. @@ -236,3 +237,4 @@ Tell us what you build, and what gets in the way, in the `prisma-compute` channe - 2026-10-30: "What changed since the public beta" and "You pay for what your app runs" now say a paid plan's hard spend limit is one you set in the Console, with none until you set one, and that it caps usage charges in a billing cycle. Source: Prisma's [billing docs](https://www.prisma.io/docs/console/more/billing#cap-usage-charges-with-a-spending-limit), checked 2026-10-30. - 2026-11-09: "You pay for what your app runs" now says a spend limit counts usage charges in a billing cycle and stops queries to the workspace's databases when it is reached. Source: Prisma's [billing docs](https://www.prisma.io/docs/console/more/billing#cap-usage-charges-with-a-spending-limit), checked 2026-11-09. +- 2026-11-09: the `npx prisma dev` and `npx prisma deploy` commands no longer name `module.ts`, because the CLI now reads the entry from the `composer` section of `prisma.config.ts`, and the example `prisma.config.ts` now sets it with `entry: "./module.ts"`. The isolated-copy command uses `--environment `, which replaced `--stage `. Source: Prisma's [`deploy` reference](https://www.prisma.io/docs/cli/deploy), checked 2026-11-09. diff --git a/apps/blog/content/blog/prisma-orm-8-nestjs/index.mdx b/apps/blog/content/blog/prisma-orm-8-nestjs/index.mdx index b32e426f954..9f104854fe3 100644 --- a/apps/blog/content/blog/prisma-orm-8-nestjs/index.mdx +++ b/apps/blog/content/blog/prisma-orm-8-nestjs/index.mdx @@ -2,7 +2,7 @@ title: "The new way to use Prisma ORM 8 in NestJS" slug: "prisma-orm-8-nestjs" date: "2026-09-24" -updatedAt: "2026-10-23" +updatedAt: "2026-11-09" authors: - "Ankur Datta" metaTitle: "How to use Prisma ORM 8 in NestJS: setup, queries, deploy" @@ -18,7 +18,7 @@ seriesIndex: 15 [Prisma ORM 8](https://www.prisma.io/docs/orm), the new major version of Prisma's TypeScript ORM, changes how you wire the client into [NestJS](https://nestjs.com). The Prisma ORM 8 client is a plain object exported by `src/prisma/db.ts`, so there is no class to extend, and the NestJS template that `create-prisma` scaffolds has no service that extends `PrismaClient`. One shared client lives in `src/prisma/db.ts`, and an injectable `PrismaService` exposes query helpers written as ordinary functions. Prisma ORM 8 is the version npm installs by default. -This post is the fifteenth in our Prisma 8 series, following [Is Prisma 8 ready for long-lived production apps?](/is-prisma-8-ready-for-long-lived-production-apps). It walks through scaffolding a NestJS API on [Prisma Postgres](https://www.prisma.io/docs/postgres), following a request from the controller to the database, writing typed queries, and deploying the API to [Prisma Compute](https://www.prisma.io/docs/compute). We ran every command below against `prisma@8.0.0-rc.15`, `@prisma/orm-postgres@8.0.0-rc.11`, and NestJS 11. +This post is the fifteenth in our Prisma 8 series, following [Is Prisma 8 ready for long-lived production apps?](/is-prisma-8-ready-for-long-lived-production-apps). It walks through scaffolding a NestJS API on [Prisma Postgres](https://www.prisma.io/docs/postgres), following a request from the controller to the database, writing typed queries, and deploying the API to [Prisma Compute](https://www.prisma.io/docs/compute). We ran every command below against `prisma@8.0.0-rc.15`, `@prisma/orm-postgres@8.0.0-rc.11`, and NestJS 11, except the deploy command, which is shown in the form that `prisma@8.0.0-rc.28` and later accept. ## Share your client without extending it @@ -239,10 +239,10 @@ The scaffold includes `module.ts` and `service.ts`, which describe the app and i ```bash npx prisma auth login npm run build -npx prisma deploy module.ts +npx prisma deploy ``` -`prisma auth login` opens the browser once. `npm run build` bundles the app with `tsdown` into `dist/server.mjs`. `prisma deploy module.ts` provisions the database and the compute service and prints the app URL. `npm run deploy` runs the last two together. +`prisma auth login` opens the browser once, and `npm run build` bundles the app with `tsdown` into `dist/server.mjs`. `prisma deploy` provisions the database and the compute service and prints the app URL. It takes no file name: since `prisma@8.0.0-rc.28`, the CLI reads the entry from the `composer` section of `prisma.config.ts`, which the scaffold sets to `./module.ts`. `npm run deploy` runs the last two together. ```text nest-prisma-8 @@ -308,3 +308,4 @@ Try Prisma ORM 8 in your NestJS app and tell us what works well or where you get ## Update history - 2026-10-23: clarified that claiming a create-db database to keep it requires a free Prisma account. +- 2026-11-09: the deploy step runs `npx prisma deploy` without `module.ts`, because since `prisma@8.0.0-rc.28` the CLI reads the entry from the `composer` section of `prisma.config.ts`, which the `create-prisma` scaffold sets to `./module.ts`; the note on the versions we ran now says the deploy command is shown in that form. diff --git a/apps/blog/content/blog/prisma-vs-netlify/index.mdx b/apps/blog/content/blog/prisma-vs-netlify/index.mdx index 4cd76c22a23..39a7e2cdd21 100644 --- a/apps/blog/content/blog/prisma-vs-netlify/index.mdx +++ b/apps/blog/content/blog/prisma-vs-netlify/index.mdx @@ -66,7 +66,7 @@ For the availability date in the first row and the FAQ, checked 2026-11-02: the Compute runs your Node.js, Bun or Next.js server on Bun, as an instance that scales to zero when idle. Only the first byte of a response has a deadline: it must go out within 60 seconds, and a streamed response keeps going after that. `waitUntil` keeps the instance awake to finish work after the response is sent, on a best-effort basis. Compute does not run WebSocket servers today (support is planned for early 2027), and each service runs in one region. -**Netlify is the better fit** when your app is mostly pages and assets served from its edge network, or when you want every preview to start with a copy of production data. On Prisma, a preview's database is created by you or by a Composer stage deploy, and it starts *empty*. +**Netlify is the better fit** when your app is mostly pages and assets served from its edge network, or when you want every preview to start with a copy of production data. On Prisma, a preview's database is created by you or by a Composer deploy of the branch, and it starts *empty*. ## Why teams leave Netlify @@ -308,7 +308,7 @@ Netlify has no concept of one deployed service calling another. If your backend 2. **Give each service a contract**, meaning typed request and response schemas written with arktype, zod, or any Standard Schema validator. 3. **Declare the contracts a service calls** as its dependencies. At runtime the service receives a typed client for each one. 4. **Wire everything in a root module.** TypeScript checks the wiring, so binding a dependency to a service with a different contract, or leaving out a handler the contract requires, is a compile error. -5. **Run `npx prisma deploy module.ts`**, or push once the deploy workflow is committed. It creates the services on Prisma Compute, the databases on Prisma Postgres, and the authenticated connections between them. Application code never builds a URL from `process.env`. +5. **Run `npx prisma deploy`**, or push once the deploy workflow is committed. The CLI loads the root module named by `entry` in the `composer` section of `prisma.config.ts`, such as `./module.ts`; a push deploy instead uses the deploy action's `module` input, which defaults to `module.ts`, so set that input if your entry lives elsewhere. The deploy creates the services on Prisma Compute, the databases on Prisma Postgres, and the authenticated connections between them. Application code never builds a URL from `process.env`. ![What each platform connects: on Prisma, the repository holds the data contract, the service contract, and the root module; prisma deploy provisions the storefront and catalog services on Prisma Compute and a Prisma Postgres database typed by the contract. On Netlify, the repository holds the site and its functions; a git push builds and publishes both, and Netlify Database connects a Postgres branch per preview through NETLIFY_DB_URL.](/prisma-vs-netlify/imgs/what-each-platform-connects.svg) @@ -358,7 +358,7 @@ Both platforms can give every branch other than the production branch a running 4. Redeploy the branch so it picks up the new `DATABASE_URL`, because variables are resolved at deploy time and changing one does not trigger a redeploy. 5. Seed it if the feature needs realistic rows, because it starts empty. -With Composer, the deploy action deploys each pushed branch other than the default one as a stage, and `npx prisma deploy module.ts --stage ` does the same from your terminal. A stage deploy replaces the first four steps: it creates the databases the module declares, passes each service its connection, and applies the committed migrations of each `postgres()` database before the services start. Those databases still start empty, because preview data is not copied from production. +With Composer, the deploy action deploys each pushed branch other than the default one as an environment named after the branch, and `npx prisma deploy --environment ` does the same from your terminal. That deploy replaces the first four steps: it creates the databases the module declares, passes each service its connection, and applies the committed migrations of each `postgres()` database before the services start. Those databases still start empty, because preview data is not copied from production. A preview uses whatever `DATABASE_URL` its preview scope or branch override gives it, so if that value is the production connection string, the preview *writes to production*. Keep production and preview values in separate scopes, as the [environment variables docs](https://www.prisma.io/docs/compute/environment-variables) describe. @@ -447,7 +447,7 @@ Prisma Compute runs a server, not separate functions. It runs your whole HTTP se Prisma replaces part of what Netlify does. For a TypeScript app built for Node.js, Bun or Next.js, Prisma Compute can host the app and its API on Bun, and Prisma Postgres can replace Netlify Database. Prisma does not replace Netlify's edge network, caching, Image CDN, or Identity. Compute has no WebSocket servers today (support is planned for early 2027), runs each service in one region, and gives a request 60 seconds to start responding. -Each preview gets its own database once you or a Composer stage deploy create it, and that database starts without production data. Each Git branch is an isolated environment. With Composer, the stage deploy creates the database, applies its migrations, and passes the connection to your services. Without Composer, you create the database with the CLI, point a preview-scoped or branch-scoped `DATABASE_URL` at it, apply your migrations, and redeploy, and that separate `DATABASE_URL` keeps the preview off production. +Each preview gets its own database once you create it or a Composer deploy of the branch does, and that database starts without production data. Each Git branch is an isolated environment. With Composer, the deploy of the branch creates the database, applies its migrations, and passes the connection to your services. Without Composer, you create the database with the CLI, point a preview-scoped or branch-scoped `DATABASE_URL` at it, apply your migrations, and redeploy, and that separate `DATABASE_URL` keeps the preview off production. The migration graph is a record of which schema version each migration starts from and produces. After two branches merge, you plan one migration to the merged schema, and `db migrate` follows the recorded migrations from each deployed database's current version to reach it. A development database left on a pre-merge state is brought to the merged schema with `db update`. It is an ORM feature and works on any host, including Netlify. @@ -488,6 +488,7 @@ Prisma ORM works with Netlify Database, which is PostgreSQL built on Neon, and i ## Update history +- 2026-11-09: step 5 of "What each platform sets up for you" now runs `npx prisma deploy` and says the CLI loads the root module named by `entry` in the `composer` section of `prisma.config.ts`, while a push deploy takes it from the deploy action's `module` input; "Previews and their databases" now names the terminal command `npx prisma deploy --environment `, because `--environment` replaced `--stage`; and the paragraph under "Pick by app type" and the FAQ on preview databases say "a Composer deploy of the branch" in place of "a Composer stage deploy". Sources: Prisma's [`deploy` reference](https://www.prisma.io/docs/cli/deploy) and the [deploy action's inputs](https://github.com/prisma/cloud-deploy-action#inputs), checked 2026-11-09. - 2026-11-09: a new FAQ entry covers whether the Node.js APIs and npm packages an app relies on work on Prisma Compute's Bun runtime and how to check before moving, from the Compute docs; the "Usage-based bill you need to cap" row now lists Prisma Postgres with a spend limit set, and that row and "Why teams leave Netlify" now say the limit counts usage charges, not the plan fee, and stops queries to the workspace's databases when it is reached; and the "The bill stopped being predictable" bullet now says usage-metered hosts differ in what a limit stops, in place of how they cap the bill. Checked against Prisma's [billing docs](https://www.prisma.io/docs/console/more/billing#cap-usage-charges-with-a-spending-limit), [Compute FAQ](https://www.prisma.io/docs/compute/faq), [Compute limitations](https://www.prisma.io/docs/compute/limitations) and [local development docs](https://www.prisma.io/docs/local-development/app-development) on 2026-11-09. - 2026-11-08: the summary under the title now says Prisma Compute has been generally available since August 2026; the Vercel profile now says Vercel Postgres is no longer available and new projects add Postgres from the Vercel Marketplace, where Prisma Postgres, Neon and Supabase are listed; and the Fly.io "Best for" line now says a Fly.io Managed Postgres cluster runs in the one region you choose. Checked against Vercel's [Postgres docs](https://vercel.com/docs/postgres) and [Marketplace storage docs](https://vercel.com/docs/marketplace-storage), and Fly.io's [cluster docs](https://docs.fly.io/postgres/create-and-connect/), on 2026-11-06. - 2026-11-06: the free-plan row of "Pick by app type" now gives Fly.io's free trial for new accounts as $1 of credit for Machines, Sprites and Managed Postgres, which lasts 7 days or until it is used up, with no credit card needed, in place of the earlier trial terms; and the list of what "Prisma" means in this post now says the ORM is optional. Checked against Fly.io's [pricing docs](https://docs.fly.io/about/pricing/) on 2026-11-06. diff --git a/apps/blog/content/blog/prisma-vs-vercel/index.mdx b/apps/blog/content/blog/prisma-vs-vercel/index.mdx index e80d0053247..d52322915c7 100644 --- a/apps/blog/content/blog/prisma-vs-vercel/index.mdx +++ b/apps/blog/content/blog/prisma-vs-vercel/index.mdx @@ -2,7 +2,7 @@ title: "Prisma vs Vercel: where should you build your next TypeScript app?" slug: "prisma-vs-vercel" date: "2026-09-16" -updatedAt: "2026-11-03" +updatedAt: "2026-11-09" authors: - "Shane Neubauer" metaTitle: "Prisma vs Vercel for TypeScript apps: which platform?" @@ -59,7 +59,7 @@ Choose Vercel if: | Typed data access | Prisma ORM 8 or any client | Any ORM or client, including Prisma ORM | | Service-to-service calls | Composer binds each dependency to a typed contract and checks it at compile time | Service bindings (beta) inject a URL; types are yours to add | | Previews | One environment per Git branch, deleted with the branch | One preview URL per Git branch | -| Preview databases | One per branch, created by you or by a Composer stage deploy, no production data | Provider-specific; Neon copies production per branch | +| Preview databases | One per branch, created by you or by a Composer deploy of the branch, no production data | Provider-specific; Neon copies production per branch | | Long-running work | 60 seconds to first byte, then `waitUntil`; no WebSockets | Continuous background workers from container images with [Daemons](https://vercel.com/docs/daemons) (public beta since [2026-10-15](https://vercel.com/changelog/vercel-daemons-is-now-in-public-beta), all plans); production only during beta, no inbound HTTP | | Billing | Plan fee plus requests, memory, CPU, and bandwidth | Plan fee plus compute, delivery, builds, and seats | @@ -127,7 +127,7 @@ Both platforms give every branch other than the production branch a running prev 2. Point the branch at it: `npx prisma@latest project env add DATABASE_URL= --branch feature/search`. 3. Seed it if the feature needs realistic rows, because it starts empty. -Declaring the database in the module replaces the first two steps. The stage deploy that the action runs for each pushed branch other than the default one, the same as `npx prisma@latest deploy module.ts --stage ` from a terminal, creates the databases the module declares and runs their migrations, but the databases still start empty. +Declaring the database in the module replaces the first two steps. The deploy that the action runs for each pushed branch other than the default one, to an environment named after the branch, creates the databases the module declares and runs their migrations, but the databases still start empty. From a terminal, `npx prisma@latest deploy --environment ` does the same. A preview uses whatever `DATABASE_URL` it was given, so a preview that inherits the production value *writes to production*. Keep production and preview values in separate scopes, as the [environment variables docs](https://www.prisma.io/docs/compute/environment-variables) describe. @@ -199,7 +199,7 @@ To run migrations, add `npx prisma@latest db migrate --db "$DATABASE_URL"` to yo For a TypeScript app, mostly. Prisma Compute hosts the app and Prisma Postgres holds the data. It does not replace Vercel's platform-level Next.js caching and image optimization, and Compute has no WebSockets, no multi-region deployment, and a 60-second limit before a request must start responding. -Yes, if you create it. Each Git branch is an isolated environment, but you provision the database with the CLI or a Composer stage deploy, and it starts without production data. A preview-scoped or branch-scoped `DATABASE_URL` keeps the preview off production. +Yes, if you create it. Each Git branch is an isolated environment, but you provision the database with the CLI or a Composer deploy of the branch, and it starts without production data. A preview-scoped or branch-scoped `DATABASE_URL` keeps the preview off production. A record of which schema version each migration starts from and produces. After two branches merge, the ORM can plan a path from each database's current version to the merged schema. It is an ORM feature and works on any host, including Vercel. @@ -217,4 +217,5 @@ Yes. The Prisma Postgres Marketplace integration provisions a database and sets ## Update history +- 2026-11-09: "Previews and their databases" now gives the terminal command as `npx prisma@latest deploy --environment `, without `module.ts`, because `--environment` replaced `--stage` and the CLI reads the entry from the `composer` section of `prisma.config.ts`; the comparison table and the FAQ on preview databases say "a Composer deploy of the branch" in place of "a Composer stage deploy". Source: Prisma's [`deploy` reference](https://www.prisma.io/docs/cli/deploy), checked 2026-11-09. - 2026-11-03: "Previews and their databases" now says the Prisma Postgres integration sets `DATABASE_URL`, `POSTGRES_URL`, `PRISMA_DATABASE_URL`, and `DATABASE_URL_POOLED` instead of only `DATABASE_URL`, and that a project with no `DATABASE_URL_POOLED` has a database created before 2026-10-29. No other facts changed. diff --git a/apps/blog/content/blog/railway-security-incident-lessons-and-migration/index.mdx b/apps/blog/content/blog/railway-security-incident-lessons-and-migration/index.mdx index f241e9ede20..8246198975d 100644 --- a/apps/blog/content/blog/railway-security-incident-lessons-and-migration/index.mdx +++ b/apps/blog/content/blog/railway-security-incident-lessons-and-migration/index.mdx @@ -2,7 +2,7 @@ title: "Railway's security incident: How to secure your Prisma Postgres database, and what to do next" slug: "railway-security-incident-lessons-and-migration" date: "2026-10-23" -updatedAt: "2026-11-03" +updatedAt: "2026-11-09" authors: - "Ankur Datta" tags: @@ -168,7 +168,7 @@ If you only wanted to move the database, you're done, and your application can k If your application is a supported TypeScript HTTP service, you can also run it on Prisma Compute. For an existing application, [Prisma Composer](https://www.prisma.io/docs/composer) describes your services, dependencies, and configuration. -The idea is to add the configuration Compute needs to build and run your application: a `service.ts` declaration, a `module.ts` entry point, and Composer configuration in `prisma.config.ts`. Your server code changes too: it uses the port Compute provides and receives its database connection through a configured secret. The [Composer porting guide](https://www.prisma.io/docs/composer/porting-an-app) walks through those changes. +The idea is to add the configuration Compute needs to build and run your application: a `service.ts` declaration, a `module.ts` entry point, and a `composer` section in `prisma.config.ts` whose `entry` names `./module.ts`. Your server code changes too: it uses the port Compute provides and receives its database connection through a configured secret. The [Composer porting guide](https://www.prisma.io/docs/composer/porting-an-app) walks through those changes. Once your application is configured, create a project for the service, add the database connection string as a secret, and deploy: @@ -183,7 +183,7 @@ npx prisma@latest project env add POSTGRES_URL --role production npm run build -npx prisma@latest deploy module.ts +npx prisma@latest deploy ``` I used `POSTGRES_URL` because Composer reserves names such as `DATABASE_URL` and `DATABASE_URL_POOLED` for databases it manages. Deploy the application into its own project rather than the database's; deploying into the database's project hit a Composer bootstrap error in my test. @@ -209,3 +209,4 @@ If anything about your database looks wrong, email [support@prisma.io](mailto:su ## Update history - 2026-11-03: removed a status line about Prisma Composer from the deployment step, which now says that your server code changes too. The Railway PostgreSQL step now says that Regenerate redeploys running services that reference the password, and what still needs the new password by hand. It also now separates a standalone database, which restarts, from a high availability cluster, which doesn't. Sources: Prisma's Composer porting guide, Railway's Database View docs and 2026-10-30 changelog, checked 2026-11-02. +- 2026-11-09: the deployment step runs `npx prisma@latest deploy` without `module.ts` and says the `composer` section of `prisma.config.ts` names the entry, because since `prisma@8.0.0-rc.28` the CLI reads the entry from there and a file name on the command line fails with `CLI.INVALID_ARGUMENTS`. Source: Prisma's [`deploy` reference](https://www.prisma.io/docs/cli/deploy) and [changelog](https://www.prisma.io/changelog/2026-10-30), checked 2026-11-09. diff --git a/apps/blog/content/blog/ship-risky-schema-changes-without-a-shared-staging-database/index.mdx b/apps/blog/content/blog/ship-risky-schema-changes-without-a-shared-staging-database/index.mdx index e3dfabc70d9..9832c6aa3bd 100644 --- a/apps/blog/content/blog/ship-risky-schema-changes-without-a-shared-staging-database/index.mdx +++ b/apps/blog/content/blog/ship-risky-schema-changes-without-a-shared-staging-database/index.mdx @@ -2,7 +2,7 @@ title: "Ship risky schema changes without a shared staging database" slug: "ship-risky-schema-changes-without-a-shared-staging-database" date: "2026-07-24" -updatedAt: "2026-10-27" +updatedAt: "2026-11-09" authors: - "Shane Neubauer" - "Ankur Datta" @@ -76,16 +76,16 @@ The root cause is one database serving multiple migration timelines, so the fix ## One database per preview -On Prisma Compute, a preview is a real resource in your project, a preview branch with its own services and, for each database your Composer module declares, its own new database. Deploy a stage name that doesn't exist yet and Compute provisions an isolated environment for it: +On Prisma Compute, a preview is a real resource in your project, a preview branch with its own services and, for each database your Composer module declares, its own new database. Deploy to an environment that doesn't exist yet and Compute provisions it as an isolated copy of the app: -With deploy on push set up, you don't run that command yourself: a push to the `remove-legacy-name` branch runs the same deploy in GitHub Actions, with the stage named after the branch. For a database declared with `postgres()`, the deploy applies your committed `migrations/` before the service starts, so the preview database starts with your schema and no rows. A `rawPostgres()` database starts empty and is yours to migrate. +With deploy on push set up, you don't run that command yourself: a push to the `remove-legacy-name` branch deploys from GitHub Actions to an environment named after the branch. For a database declared with `postgres()`, the deploy applies your committed `migrations/` before the service starts, so the preview database starts with your schema and no rows. A `rawPostgres()` database starts empty and is yours to migrate. Alice's preview gets a database with her schema. Bob's preview gets a database with his. Neither can break the other, and neither needs to rebase until merge time. When Bob does rebase after Alice merges, he replans against the updated contract and tests the result on his own preview database first. @@ -325,7 +325,7 @@ jobs: build-command: npm run build ``` -The action derives the target from the branch: a push to the default branch deploys production, and a push to any other branch runs `prisma deploy module.ts --stage `. The job exchanges its GitHub OIDC token for a short-lived Prisma token, so the workflow needs no repository secrets. A branch's first push creates its preview database, and every deploy applies your committed `migrations/` to a `postgres()` database before the service starts, so each step of the expand-and-contract sequence runs on the preview before it reaches production. +The action derives the target from the branch: a push to the default branch deploys production, and a push to any other branch deploys an environment named after the branch. The job exchanges its GitHub OIDC token for a short-lived Prisma token, so the workflow needs no repository secrets. A branch's first push creates its preview database, and every deploy applies your committed `migrations/` to a `postgres()` database before the service starts, so each step of the expand-and-contract sequence runs on the preview before it reaches production. One piece of wiring is yours to choose: how integration tests get the preview database's connection string. The action keeps its credential to its own step, so a test step that needs one uses a service token: set `PRISMA_SERVICE_TOKEN` and `PRISMA_WORKSPACE_ID` as Actions secrets, find the branch's database with `npx prisma postgres list --project my-app --branch "$GITHUB_REF_NAME"`, and create a connection for it with `npx prisma postgres connection create --name ci --project my-app --branch "$GITHUB_REF_NAME"`, which prints the connection string once. Each run adds a connection, so delete it after the tests with `npx prisma postgres connection delete --confirm `. Keep any stored value in your own secret store; Compute's [environment variables](https://www.prisma.io/docs/compute/environment-variables) are write-only, so CI can't read them back. @@ -352,7 +352,7 @@ No. Each preview database is new, and production data is not copied. For a `post When the repository is connected to the project, deleting a Git branch tears down the matching preview: its services, databases and buckets are removed. Automated cleanup never touches production or the default branch. -Partly. The isolation comes from Prisma Compute previews, not from Prisma ORM 8, and Compute doesn't require Prisma ORM: declare the database with `rawPostgres()`, which hands your service a connection string, query it with any PostgreSQL client, and run your migrations against it yourself, since the deploy applies migrations only for a `postgres()` database. The deploy itself needs the Prisma 8 CLI: `prisma deploy` exists only there (8.0.0-rc.8 or later), and deploy on push runs your repository's installed `prisma` CLI when it has one. In a repository whose `prisma` package is Prisma 7, that is Prisma 7's CLI, which has no `deploy` command, so the deploy step fails. This post uses Prisma 8 because its TypeScript migrations and `dataTransform` make expand-and-contract easier to write and review. +Partly. The isolation comes from Prisma Compute previews, not from Prisma ORM 8, and Compute doesn't require Prisma ORM: declare the database with `rawPostgres()`, which hands your service a connection string, query it with any PostgreSQL client, and run your migrations against it yourself, since the deploy applies migrations only for a `postgres()` database. The deploy itself needs the Prisma 8 CLI: `prisma deploy` exists only there, and the commands in this post need 8.0.0-rc.30 or later, which reads the entry from `prisma.config.ts` and takes `--environment` (the [October 30](https://www.prisma.io/changelog/2026-10-30) and [November 4](https://www.prisma.io/changelog/2026-11-04) changelogs list the steps for an app first deployed with an older release). Deploy on push runs your repository's installed `prisma` CLI when it has one. In a repository whose `prisma` package is Prisma 7, that is Prisma 7's CLI, which has no `deploy` command, so the deploy step fails. This post uses Prisma 8 because its TypeScript migrations and `dataTransform` make expand-and-contract easier to write and review. Neon branches copy schema and data from a parent branch by default. A Compute preview database is not a copy: it is new, and your migrations and seeds build it up. Copying is faster for manual poking around; a database built only from your migrations proves they work end-to-end and keeps production data out of previews. @@ -367,6 +367,6 @@ To try the workflow, start a project with [Prisma 8](/prisma-next-early-access-w npx prisma@latest orm init ``` -Write a contract, plan a migration, and read the `migration.ts` and `ops.json` it produces. Then [deploy the app to Compute](https://www.prisma.io/docs/prisma-compute/deploy) as a Prisma Composer module that declares the database with `postgres()`, and set up [deploy on push](https://www.prisma.io/docs/compute/deploy-on-push). From then on, each feature branch you push gets a preview with its own new database and your migrations applied, ready for the expand-and-contract cycle. Without GitHub, `npx prisma deploy module.ts --stage ` deploys the same kind of preview from your terminal. +Write a contract, plan a migration, and read the `migration.ts` and `ops.json` it produces. Then [deploy the app to Compute](https://www.prisma.io/docs/prisma-compute/deploy) as a Prisma Composer module that declares the database with `postgres()`; the CLI finds that module through `entry` in the `composer` section of `prisma.config.ts`. Then set up [deploy on push](https://www.prisma.io/docs/compute/deploy-on-push). From then on, each feature branch you push gets a preview with its own new database and your migrations applied, ready for the expand-and-contract cycle. Without GitHub, `npx prisma deploy --environment ` deploys the same kind of preview from your terminal. Tell us what worked and what didn't on [Discord](https://pris.ly/discord) in the `#prisma-next` channel, and **star [prisma/prisma](https://github.com/prisma/orm) on GitHub** to follow development. diff --git a/apps/docs/src/components/concept-animation/presets.ts b/apps/docs/src/components/concept-animation/presets.ts index 0bcc6fe5479..d12617b00b5 100644 --- a/apps/docs/src/components/concept-animation/presets.ts +++ b/apps/docs/src/components/concept-animation/presets.ts @@ -27,7 +27,7 @@ export const CONCEPT_PRESETS = { { title: "1. First deploy", code: - "$ [[npx prisma@latest deploy module.ts]]\n" + + "$ [[npx prisma@latest deploy]]\n" + " │\n" + " ▼\n" + "project: my-app\n" + @@ -38,14 +38,14 @@ export const CONCEPT_PRESETS = { { title: "2. Preview branch", code: - "$ [[npx prisma@latest deploy module.ts --stage feature/login]]\n" + + "$ [[npx prisma@latest deploy --environment feature/login]]\n" + " │\n" + " ▼\n" + "project: my-app\n" + "├─ branch: main (production) → service + database\n" + "└─ branch: feature/login (preview) → service + database [[← new copy]]", caption: - "Deploy with --stage and Compute provisions a full copy of the infrastructure as a preview branch: feature/login gets its own service, database, and URL. Production stays untouched.", + "Deploy with --environment and Compute provisions a full copy of the infrastructure as a preview branch: feature/login gets its own service, database, and URL. Production stays untouched.", }, { title: "3. Connect GitHub", diff --git a/apps/site/content/answers/compute/ai-assistant-conversation-history.mdx b/apps/site/content/answers/compute/ai-assistant-conversation-history.mdx index d94d9ed669c..6051fad5c78 100644 --- a/apps/site/content/answers/compute/ai-assistant-conversation-history.mdx +++ b/apps/site/content/answers/compute/ai-assistant-conversation-history.mdx @@ -5,7 +5,7 @@ summary: "Use an app host for the assistant's server and managed Postgres for co author: "Søren Bramer Schmidt" authorUrl: "https://github.com/sorenbs" date: "2026-10-18" -updatedAt: "2026-10-22" +updatedAt: "2026-11-09" readingTime: "7 min read" faq: - question: "Does a streaming response save itself to Postgres?" @@ -155,15 +155,15 @@ For token-level resumption, persist chunks or events before relying on them as d ### 5. Deploy and test a return visit -For a project with a `build` script and the `module.ts` prepared in step 1, authenticate, build the app and deploy a separate review stage. Configure the project region through the [deployment setup](/docs/cli/deploy) if it is not already set. These commands use the current [Prisma 8 release candidate CLI](/docs/orm/release-status) explicitly, so an older project-local CLI is not selected: +For a project with a `build` script and the `module.ts` prepared in step 1, named as `entry` in the `composer` section of `prisma.config.ts`, authenticate, build the app and deploy a separate review environment. Configure the project region through the [deployment setup](/docs/cli/deploy) if it is not already set. These commands use the current [Prisma 8 release candidate CLI](/docs/orm/release-status) explicitly, so an older project-local CLI is not selected: ```sh npx prisma@latest auth login npm run build -npx prisma@latest deploy --stage assistant-review +npx prisma@latest deploy --environment assistant-review ``` -Open the service URL returned by the deployment. Confirm that its database target is the intended review resource before applying migrations or testing writes. An externally supplied URL must point to a separate test database; changing the stage name does not isolate an external database by itself. +Open the service URL returned by the deployment. Confirm that its database target is the intended review resource before applying migrations or testing writes. An externally supplied URL must point to a separate test database; changing the environment name does not isolate an external database by itself. Prisma Compute runs deployed services on Bun, so check runtime-dependent packages. Its [request timeout](/docs/compute/request-timeout) gives a service 60 seconds to start responding; a response that has started streaming is not subject to that first-byte deadline. diff --git a/apps/site/content/answers/compute/ai-business-api-tool-calls.mdx b/apps/site/content/answers/compute/ai-business-api-tool-calls.mdx index 09e7df12a55..3f72c3d4ca4 100644 --- a/apps/site/content/answers/compute/ai-business-api-tool-calls.mdx +++ b/apps/site/content/answers/compute/ai-business-api-tool-calls.mdx @@ -5,7 +5,7 @@ summary: "Use managed server hosting that fits your TypeScript runtime and lets author: "Søren Bramer Schmidt" authorUrl: "https://github.com/sorenbs" date: "2026-10-20" -updatedAt: "2026-10-29" +updatedAt: "2026-11-09" readingTime: "7 min read" faq: - question: "Can I put the business API key in the browser if the model needs it?" @@ -75,7 +75,7 @@ Choose Prisma Compute when keeping the app's runtime, data and deployment contex Follow [getting started](/docs/compute/getting-started) and the [Composer input guide](/docs/composer/service-input) to declare the service and its private inputs. Build the application before deploying. Keep the business API base URL under server configuration and the API key in a secret input. -Deploy reviews to an [isolated named stage](/docs/composer/deploying#production-and-stages), for example with `--stage review`, using separate development credentials and a sandbox business account. [Environment scope](/compute/typescript-app-secrets) matters: a preview app using the real business API key can still change production business records even when its Postgres database is separate. +Deploy reviews to an [isolated named environment](/docs/composer/deploying#environments), for example with `--environment review`, using separate development credentials and a sandbox business account. [Environment scope](/compute/typescript-app-secrets) matters: a preview app using the real business API key can still change production business records even when its Postgres database is separate. ### 2. Implement the permission boundary before adding more tools diff --git a/apps/site/content/answers/compute/app-database-health-checks.mdx b/apps/site/content/answers/compute/app-database-health-checks.mdx index 1b957773432..ac9922f28ee 100644 --- a/apps/site/content/answers/compute/app-database-health-checks.mdx +++ b/apps/site/content/answers/compute/app-database-health-checks.mdx @@ -5,7 +5,7 @@ summary: "Choose a platform that groups the app and database in the same project author: "Søren Bramer Schmidt" authorUrl: "https://github.com/sorenbs" date: "2026-10-22" -updatedAt: "2026-10-22" +updatedAt: "2026-11-09" readingTime: "8 min read" faq: - question: "Does SELECT 1 prove that customers can use the app?" @@ -62,7 +62,7 @@ Prisma Compute is a practical default for a small TypeScript team that wants to ### 1. Record the actual production targets -Start with an already deployed application; [getting started](/docs/compute/getting-started) covers the first deployment. Open its project in Console and record the branch serving customers, the live service version and the database. A [platform branch](/docs/compute/branching) groups deployed service versions. The production branch is the first branch in the project, usually `main`; a named Composer stage deploy creates a separate platform branch for its services and databases. Copy the actual branch name from Console when inspecting that stage. Verify the branch in Console rather than assuming your local Git checkout selects production. Record the public URL and deployment commit too. +Start with an already deployed application; [getting started](/docs/compute/getting-started) covers the first deployment. Open its project in Console and record the branch serving customers, the live service version and the database. A [platform branch](/docs/compute/branching) groups deployed service versions. The production branch is the first branch in the project, usually `main`; a deploy to a named Composer environment creates a separate platform branch for its services and databases. Copy the actual branch name from Console when inspecting that environment. Verify the branch in Console rather than assuming your local Git checkout selects production. Record the public URL and deployment commit too. For an existing service, these [CLI commands](/docs/cli/service) inspect its version and recent logs. Replace `orders`, `web` and `main` with the actual project, service and confirmed production branch: diff --git a/apps/site/content/answers/compute/business-app-operations.mdx b/apps/site/content/answers/compute/business-app-operations.mdx index f4151ec77b9..ab657356777 100644 --- a/apps/site/content/answers/compute/business-app-operations.mdx +++ b/apps/site/content/answers/compute/business-app-operations.mdx @@ -5,7 +5,7 @@ summary: "Choose managed app hosting and managed Postgres, then make releases, b author: "Søren Bramer Schmidt" authorUrl: "https://github.com/sorenbs" date: "2026-10-20" -updatedAt: "2026-10-22" +updatedAt: "2026-11-09" readingTime: "6 min read" faq: - question: "Does managed hosting maintain my application's code?" @@ -56,7 +56,7 @@ Prisma Compute gives a small team a concrete TypeScript deployment definition fo ### 1. Establish ownership and a release boundary -Use [getting started](/docs/compute/getting-started) to prepare a Composer app and a managed database. Ask whoever prepares the app to demonstrate the build, an [isolated review deployment](/docs/composer/deploying#production-and-stages) using a named stage such as `--stage review`, and a separate production release. Define which changes you can approve yourself and who handles failures you cannot diagnose. +Use [getting started](/docs/compute/getting-started) to prepare a Composer app and a managed database. Ask whoever prepares the app to demonstrate the build, an [isolated review deployment](/docs/composer/deploying#environments) using a named environment such as `--environment review`, and a separate production release. Define which changes you can approve yourself and who handles failures you cannot diagnose. Keep reviews on [separate test data](/postgres/typescript-test-environment). If the app receives a manually supplied database URL, configure the test and production values separately. A test deployment connected to the production database can still change customer records. diff --git a/apps/site/content/answers/compute/cursor-typescript-app-hosting.mdx b/apps/site/content/answers/compute/cursor-typescript-app-hosting.mdx index 0d0d63679c1..c91f32581dd 100644 --- a/apps/site/content/answers/compute/cursor-typescript-app-hosting.mdx +++ b/apps/site/content/answers/compute/cursor-typescript-app-hosting.mdx @@ -5,7 +5,7 @@ summary: "Cursor can help configure a host that exposes a documented CLI or MCP author: "Søren Bramer Schmidt" authorUrl: "https://github.com/sorenbs" date: "2026-10-17" -updatedAt: "2026-10-17" +updatedAt: "2026-11-09" readingTime: "6 min read" faq: - question: "Does Cursor host my application?" @@ -94,13 +94,13 @@ Follow the [framework-specific deployment instructions](/docs/prisma-compute/dep Declare the review database using the [Composer database dependency guide](/docs/composer/databases), or supply a separately managed test database URL as a server-side input. For a declared dependency named `db`, the server receives its connection through `service.load().db.url`. Keep other secrets in server-side inputs. If you use manually configured connection strings, verify them independently: the deployment's name does not prove that its URL points to a test database. -### 4. Authenticate the CLI and deploy the review stage +### 4. Authenticate the CLI and deploy the review environment -From the project containing the prepared module and built artifacts, use the Prisma CLI. For a module called `module.ts`: +From the project containing the prepared module and built artifacts, use the Prisma CLI. It reads the module from `entry` in the `composer` section of `prisma.config.ts`, such as `entry: './module.ts'`: ```sh npx prisma auth login -npx prisma deploy --stage review +npx prisma deploy --environment review ``` Complete login yourself. Confirm the target project and region, then let the assistant run the approved deployment command. The deploy command does not run your framework build. Open the resulting service URL, check runtime logs and verify database writes with disposable test records. diff --git a/apps/site/content/answers/compute/from-dev-server-to-production.mdx b/apps/site/content/answers/compute/from-dev-server-to-production.mdx index 1280500d94b..39fb2cb76b9 100644 --- a/apps/site/content/answers/compute/from-dev-server-to-production.mdx +++ b/apps/site/content/answers/compute/from-dev-server-to-production.mdx @@ -5,7 +5,7 @@ summary: "Prepare a production build and supported server entry point, move dura author: "Søren Bramer Schmidt" authorUrl: "https://github.com/sorenbs" date: "2026-10-20" -updatedAt: "2026-10-20" +updatedAt: "2026-11-09" readingTime: "6 min read" faq: - question: "Can I leave npm run dev running on my laptop?" @@ -83,7 +83,7 @@ Set [server-side inputs](/compute/typescript-app-secrets) for database credentia ### 3. Deploy a review version and exercise it -Use [getting started](/docs/compute/getting-started) to authenticate, then deploy the built Composer app to a [named test stage](/docs/composer/deploying#production-and-stages): `npx prisma@latest deploy --stage review`. Verify the intended project and review stage in the deploy report. Open its actual URL from a second browser or device. Test both an allowed action and an action the current user must not be allowed to perform. +Use [getting started](/docs/compute/getting-started) to authenticate, then deploy the built Composer app to a [named test environment](/docs/composer/deploying#environments): `npx prisma@latest deploy --environment review`. Verify the intended project and review environment in the deploy report. Open its actual URL from a second browser or device. Test both an allowed action and an action the current user must not be allowed to perform. Create a fictional record, reload, then redeploy the same code and read the record again. Check login callbacks at the deployed origin, not just localhost. Confirm that invalid input produces a useful response and that logs exclude credentials and customer payloads. diff --git a/apps/site/content/answers/compute/missing-environment-variables-after-deploy.mdx b/apps/site/content/answers/compute/missing-environment-variables-after-deploy.mdx index 167c8b8d1ad..f9854472495 100644 --- a/apps/site/content/answers/compute/missing-environment-variables-after-deploy.mdx +++ b/apps/site/content/answers/compute/missing-environment-variables-after-deploy.mdx @@ -5,7 +5,7 @@ summary: "Locally, your API key comes from a `.env` file that Git ignores, so th author: "Gregory Boch" authorUrl: "https://github.com/gregory-boch-prisma" date: "2026-10-22" -updatedAt: "2026-10-22" +updatedAt: "2026-11-09" readingTime: "10 min read" faq: - question: "Should I commit .env.production so the deployment gets the key?" @@ -162,7 +162,7 @@ npx prisma@latest project env add PAYMENTS_API_KEY --role preview `project env` commands target the project the directory is linked to; in CI, pass `--project ` on each command instead ([Known limitations](/docs/compute/limitations#cli)). `add` fails if the key already exists in that scope; use `update` to replace a value. `--branch ` sets an override for one preview branch, and `--file .env.production` imports a dotenv file instead of a single key. `list` shows names and metadata, never values ([project command reference](/docs/cli/project)). Running the CLI with `npx` needs Node.js 22.18 or newer on the 22 line, 24.11 or newer on the 24 line, or 26 or newer. -A deploy can also seed the value: when a stage lacks the variable, the deploy copies it from the deploying shell ([Deploying](/docs/composer/deploying)). So a deploy from your laptop can succeed while a fresh CI stage needs the value exported in the CI job. +A deploy can also seed the value: when an environment does not have the variable yet, the deploy copies it from the deploying shell ([Deploying](/docs/composer/deploying)). So a deploy from your laptop can succeed while a new environment deployed from CI needs the value exported in the CI job. Values resolve at deploy time, so deploy again after any change: run `deploy`, push to the default branch if deploy on push is set up, or promote a version, which rebuilds it with the production variables ([Compute FAQ](/docs/compute/faq#how-do-i-rotate-a-secret)). diff --git a/apps/site/content/answers/compute/multiple-business-apps.mdx b/apps/site/content/answers/compute/multiple-business-apps.mdx index e93e711e0d6..400e73d1c91 100644 --- a/apps/site/content/answers/compute/multiple-business-apps.mdx +++ b/apps/site/content/answers/compute/multiple-business-apps.mdx @@ -5,7 +5,7 @@ summary: "Use one platform account for administration and a separate project, da author: "Søren Bramer Schmidt" authorUrl: "https://github.com/sorenbs" date: "2026-10-22" -updatedAt: "2026-10-22" +updatedAt: "2026-11-09" readingTime: "6 min read" faq: - question: "Should every app use the same Postgres database?" @@ -99,10 +99,10 @@ From one configured app's directory, build and deploy its test environment. This ```sh export PRISMA_REGION=us-east-1 npm run build -npx prisma@latest deploy --name orders --stage review +npx prisma@latest deploy --name orders --environment review ``` -The deploy prints the service URL and created resource identifiers; these vary by account. `review` names an [isolated deployment stage](/docs/composer/deploying#production-and-stages). The module's own database is created for that stage; manually supplied URLs must point to separate test resources. Repeat from the other apps' directories with their own names and configurations. Apply each app's migrations to its review database before acceptance tests. With `rawPostgres()` or a manually supplied URL, use that database's direct connection; a configured `postgres()` data contract can apply migrations during deployment. Production deployment omits `--stage review`. +The deploy prints the service URL and created resource identifiers; these vary by account. `review` names an [isolated deployment environment](/docs/composer/deploying#environments). The module's own database is created for that environment; manually supplied URLs must point to separate test resources. Repeat from the other apps' directories with their own names and configurations. Apply each app's migrations to its review database before acceptance tests. With `rawPostgres()` or a manually supplied URL, use that database's direct connection; a configured `postgres()` data contract can apply migrations during deployment. Production deployment omits `--environment review`. For [deploy on push](/docs/compute/deploy-on-push), connect each project to GitHub and configure a deployment job for each app. The guide's example runs from the repository root by default; copying it once does not deploy all apps in a shared repository. Set the deploy action's `working-directory`, `build-command` and `module` inputs for that app. If the lockfile is at the workspace root, also set `install-command` to install dependencies from that root; the action's automatic detection only checks its working directory. Set each module's exported app name to its intended project, such as `orders`, before enabling the action. The action does not carry over the earlier CLI `--name` override; its module name must select the same verified project. The connection permits authentication; the workflow installs dependencies, builds and deploys. Check each job's project target before relying on push deployment. diff --git a/apps/site/content/answers/compute/nextjs-form-submissions.mdx b/apps/site/content/answers/compute/nextjs-form-submissions.mdx index af64b889bff..7f2b1d6a21d 100644 --- a/apps/site/content/answers/compute/nextjs-form-submissions.mdx +++ b/apps/site/content/answers/compute/nextjs-form-submissions.mdx @@ -5,7 +5,7 @@ summary: "Use managed hosting that runs the Next.js server, so your form's POST author: "Søren Bramer Schmidt" authorUrl: "https://github.com/sorenbs" date: "2026-10-23" -updatedAt: "2026-10-23" +updatedAt: "2026-11-09" readingTime: "6 min read" faq: - question: "Can I host a form with a static Next.js export?" @@ -60,7 +60,7 @@ For a new business app, Prisma Compute keeps the handler, database and deploymen Follow the [Next.js framework guide](/docs/guides/frameworks/nextjs) for a new project. For an existing app, [port the server](/docs/composer/porting-an-app) by adding Composer's module and service declarations and connecting the server entry to the service. Those files describe how to build and run the app and which resources it needs. -The Compute Next.js deployment uses `output: "standalone"`, which builds the server files. Run the framework build before deployment; uploading the static `out` directory cannot run the submission handler. Start with a separate [review stage](/docs/composer/deploying#production-and-stages) and fictional submissions. +The Compute Next.js deployment uses `output: "standalone"`, which builds the server files. Run the framework build before deployment; uploading the static `out` directory cannot run the submission handler. Start with a separate [review environment](/docs/composer/deploying#environments) and fictional submissions. ### 2. Connect the database and notification credentials diff --git a/apps/site/content/answers/compute/nextjs-stripe-subscriptions.mdx b/apps/site/content/answers/compute/nextjs-stripe-subscriptions.mdx index ce60e038c03..85b116ced3b 100644 --- a/apps/site/content/answers/compute/nextjs-stripe-subscriptions.mdx +++ b/apps/site/content/answers/compute/nextjs-stripe-subscriptions.mdx @@ -5,7 +5,7 @@ summary: "Use a host that runs your Next.js server routes and a managed Postgres author: "Søren Bramer Schmidt" authorUrl: "https://github.com/sorenbs" date: "2026-10-22" -updatedAt: "2026-10-24" +updatedAt: "2026-11-09" readingTime: "7 min read" faq: - question: "Should the checkout success page grant subscription access?" @@ -58,7 +58,7 @@ For a new TypeScript business app, Prisma Compute keeps the server, database and ### 1. Build an isolated test deployment -For a new app, complete the [Next.js setup guide](/docs/guides/frameworks/nextjs). For an existing app, follow [Port an existing app](/docs/composer/porting-an-app) to add `module.ts` and `service.ts` before using the deploy commands below. These TypeScript configuration files tell Composer which server and database to create. Composer is the deployment framework included in the Prisma CLI. Keep `output: "standalone"` in `next.config.ts` so Next.js builds the server files Compute runs. +For a new app, complete the [Next.js setup guide](/docs/guides/frameworks/nextjs). For an existing app, follow [Port an existing app](/docs/composer/porting-an-app) to add `module.ts` and `service.ts`, and name `module.ts` as `entry` in the `composer` section of `prisma.config.ts`, before using the deploy commands below. These TypeScript configuration files tell Composer which server and database to create. Composer is the deployment framework included in the Prisma CLI. Keep `output: "standalone"` in `next.config.ts` so Next.js builds the server files Compute runs. Before the first deployment, follow [Service input](/docs/composer/service-input) to declare the billing configuration in `service.ts`, bind its values in `module.ts` and read them on the server through `service.input()`. Give the input schema a billing-disabled mode that permits missing Stripe secrets. In that mode, the app must avoid initializing Stripe and reject checkout and webhook processing. Disabling a checkout button alone does not change configuration validation. Start a new environment in this mode so it can receive its URL before a webhook signing secret exists. @@ -68,12 +68,12 @@ With that configuration in place, choose a [supported region](/docs/cli/deploy) export PRISMA_REGION=us-east-1 npx prisma@latest auth login npm run build -npx prisma@latest deploy --stage review +npx prisma@latest deploy --environment review ``` -The deploy prints the created service URL and database identifiers; their values depend on your account. `review` is the name of this [isolated deployment stage](/docs/composer/deploying#production-and-stages). Databases created by that module belong to the stage. Check those identifiers before testing. +The deploy prints the created service URL and database identifiers; their values depend on your account. `review` is the name of this [isolated deployment environment](/docs/composer/deploying#environments). Databases created by that module belong to the environment. Check those identifiers before testing. -Register a Stripe test webhook endpoint at your handler's path on the review URL. Bind the test API key and that endpoint's signing secret with `envSecret(...)`, then switch to billing-enabled configuration that requires both secrets. The API key authorizes calls to Stripe; the signing secret verifies incoming webhooks. The Service input guide explains how a missing stage variable is seeded from the deploying shell. Give test and production their own values, and update existing platform variables through the environment-variable workflow rather than expecting a changed shell value to replace them. A named stage does not change a manually supplied database URL or payment credential. With the test secrets supplied, rerun `npm run build` and `npx prisma@latest deploy --stage review` from the app directory before billing tests. +Register a Stripe test webhook endpoint at your handler's path on the review URL. Bind the test API key and that endpoint's signing secret with `envSecret(...)`, then switch to billing-enabled configuration that requires both secrets. The API key authorizes calls to Stripe; the signing secret verifies incoming webhooks. The Service input guide explains how a variable an environment does not have yet is seeded from the deploying shell. Give test and production their own values, and update existing platform variables through the environment-variable workflow rather than expecting a changed shell value to replace them. A named environment does not change a manually supplied database URL or payment credential. With the test secrets supplied, rerun `npm run build` and `npx prisma@latest deploy --environment review` from the app directory before billing tests. @@ -93,7 +93,7 @@ Inspect delivery results in Stripe and application logs at the same time. Log th ### 4. Release production deliberately -After your billing tests pass in the review deployment, release the approved commit with production credentials and configuration. For an existing production database, apply its reviewed migrations before the app release. For a new database using `rawPostgres()` or a manually supplied URL, provision it with live checkout disabled, obtain its direct connection and apply migrations before accepting customer traffic. A configured `postgres()` data contract can apply migrations during deployment. Build before deploying; omitting `--stage review` targets production. Register the production webhook URL in Stripe and configure its own signing secret. If production needs its first URL, use the billing-disabled bootstrap mode described in step 1: its schema must permit absent Stripe secrets and its code must avoid initializing billing. After registering the endpoint, save the production secrets, switch to the billing-enabled configuration, rebuild and redeploy before accepting payments. Verify the URL, signature rejection and the database target before enabling live checkout. +After your billing tests pass in the review deployment, release the approved commit with production credentials and configuration. For an existing production database, apply its reviewed migrations before the app release. For a new database using `rawPostgres()` or a manually supplied URL, provision it with live checkout disabled, obtain its direct connection and apply migrations before accepting customer traffic. A configured `postgres()` data contract can apply migrations during deployment. Build before deploying; omitting `--environment review` targets production. Register the production webhook URL in Stripe and configure its own signing secret. If production needs its first URL, use the billing-disabled bootstrap mode described in step 1: its schema must permit absent Stripe secrets and its code must avoid initializing billing. After registering the endpoint, save the production secrets, switch to the billing-enabled configuration, rebuild and redeploy before accepting payments. Verify the URL, signature rejection and the database target before enabling live checkout. Choose a [backup plan](/docs/postgres/database/backups), rehearse restoration and define how to reconcile restored subscription records with Stripe. A database snapshot can predate a payment or cancellation. Review [hosting spending controls](/compute/typescript-hosting-spending-controls) separately from the subscription prices you charge customers. diff --git a/apps/site/content/answers/compute/nextjs-traffic-bursts.mdx b/apps/site/content/answers/compute/nextjs-traffic-bursts.mdx index 14bbb0b0254..da16e04cf7b 100644 --- a/apps/site/content/answers/compute/nextjs-traffic-bursts.mdx +++ b/apps/site/content/answers/compute/nextjs-traffic-bursts.mdx @@ -5,7 +5,7 @@ summary: "Use managed Next.js hosting with a database close to its server, then author: "Søren Bramer Schmidt" authorUrl: "https://github.com/sorenbs" date: "2026-10-20" -updatedAt: "2026-10-20" +updatedAt: "2026-11-09" readingTime: "7 min read" faq: - question: "Does emailing 3,000 people mean 3,000 concurrent users?" @@ -56,7 +56,7 @@ Prisma Postgres includes [connection pooling](/docs/postgres/database/connection ### 1. Freeze and verify the release -Follow [getting started](/docs/compute/getting-started) to prepare the Next.js Composer service and build its artifact. For the rehearsal, deploy to a [named test stage](/docs/composer/deploying#production-and-stages), for example with `--stage rehearsal`, instead of the production default. Keep the source commit and deployed version together. If deployments run on Git pushes, make sure the repository has the [deploy workflow](/docs/compute/deploy-on-push); connecting GitHub alone does not deploy a push. +Follow [getting started](/docs/compute/getting-started) to prepare the Next.js Composer service and build its artifact. For the rehearsal, deploy to a [named test environment](/docs/composer/deploying#environments), for example with `--environment rehearsal`, instead of the production default. Keep the source commit and deployed version together. If deployments run on Git pushes, make sure the repository has the [deploy workflow](/docs/compute/deploy-on-push); connecting GitHub alone does not deploy a push. Use a separate test database with representative fictional records. Configure manually supplied database URLs per environment, and use the pooled application endpoint for normal Prisma Postgres queries. Keep the pool bounded in each application instance, so more instances do not each open an unnecessarily large pool. diff --git a/apps/site/content/answers/compute/share-app-with-client.mdx b/apps/site/content/answers/compute/share-app-with-client.mdx index bf54b30bd8d..bf29c66de45 100644 --- a/apps/site/content/answers/compute/share-app-with-client.mdx +++ b/apps/site/content/answers/compute/share-app-with-client.mdx @@ -5,7 +5,7 @@ summary: "Publish the app to a managed host that runs your framework and gives y author: "Søren Bramer Schmidt" authorUrl: "https://github.com/sorenbs" date: "2026-10-17" -updatedAt: "2026-10-17" +updatedAt: "2026-11-09" readingTime: "5 min read" faq: - question: "Can I send my client a localhost link?" @@ -72,22 +72,22 @@ Declare a Prisma Postgres database with the app, or configure a separate existin For a [declared database dependency](/docs/composer/databases) named `db`, read `service.load().db.url` in server code and pass it to your PostgreSQL client. Composer supplies this connection; it does not require a separate database URL environment variable. For a separately managed database, configure its URL as a server-side environment input instead. Keep session secrets and integration credentials server-side too. Never put database credentials in browser code or a public environment variable. Make the app's database access depend on the authenticated user, rather than trusting a customer ID sent by the browser. -### 3. Build and deploy a review stage +### 3. Build and deploy a review environment -Once the Composer module and its inputs are configured, run the build specified by your framework guide, then authenticate and deploy. For a module named `module.ts`, the deployment command is: +Once the Composer module and its inputs are configured, run the build specified by your framework guide, then authenticate and deploy. The CLI reads the module from `entry` in the `composer` section of `prisma.config.ts`, such as `entry: './module.ts'`, so the deployment command is: ```sh npx prisma auth login -npx prisma deploy --stage client-review +npx prisma deploy --environment client-review ``` -The deploy command does not build the application for you. It deploys the prepared artifacts and reports the service URL. Copy the actual HTTPS URL from that result; its hostname ends in `.prisma.build`. For a declared database, open Prisma Console and locate the database resource belonging to the `client-review` stage you just deployed, then get its direct connection string for migration tools that need one. For a separately managed database, get the migration connection from that database's provider and verify that it targets the database configured for the review app. In either case, check the database ID against production before running migrations or seeds. +The deploy command does not build the application for you. It deploys the prepared artifacts and reports the service URL. Copy the actual HTTPS URL from that result; its hostname ends in `.prisma.build`. For a declared database, open Prisma Console and locate the database resource belonging to the `client-review` environment you just deployed, then get its direct connection string for migration tools that need one. For a separately managed database, get the migration connection from that database's provider and verify that it targets the database configured for the review app. In either case, check the database ID against production before running migrations or seeds. ### 4. Test as the client before sending the link Open the URL in a separate browser profile, submit a form, reload the page and confirm the saved record remains. For a private demo, sign in with the intended demo account first, then try an API request without a session and confirm it cannot read private records. Check that login callbacks and links return to the deployed address. -Use the assigned HTTPS URL for the review stage. [Custom domains](/docs/compute/domains) currently attach only to production apps. For a branded demo domain, use a separate demo project's production deployment and follow its DNS and certificate setup. Wait for HTTPS to work on the final address before sharing it. If the generated URL works and the custom domain doesn't, see [what to configure when a custom domain fails](/compute/custom-domain-not-working). Remove review access and clean up demo resources when the review ends. +Use the assigned HTTPS URL for the review environment. [Custom domains](/docs/compute/domains) currently attach only to production apps. For a branded demo domain, use a separate demo project's production deployment and follow its DNS and certificate setup. Wait for HTTPS to work on the final address before sharing it. If the generated URL works and the custom domain doesn't, see [what to configure when a custom domain fails](/compute/custom-domain-not-working). Remove review access and clean up demo resources when the review ends. ## When should I choose another setup? diff --git a/apps/site/content/answers/postgres/booking-app-hosting.mdx b/apps/site/content/answers/postgres/booking-app-hosting.mdx index 60fc37143bc..c2ed6dafa58 100644 --- a/apps/site/content/answers/postgres/booking-app-hosting.mdx +++ b/apps/site/content/answers/postgres/booking-app-hosting.mdx @@ -5,7 +5,7 @@ summary: "Use managed TypeScript hosting and a shared Postgres database, with th author: "Søren Bramer Schmidt" authorUrl: "https://github.com/sorenbs" date: "2026-10-22" -updatedAt: "2026-10-24" +updatedAt: "2026-11-09" readingTime: "7 min read" faq: - question: "Will a faster host prevent double bookings?" @@ -58,16 +58,16 @@ For a custom TypeScript booking app, Prisma Compute keeps the request handler cl ### 1. Prepare an isolated app and database -Create a development database in your account in [Prisma Console](https://console.prisma.io). The SQL below can be tested before deploying an app. For the app itself, complete [Compute getting started](/docs/compute/getting-started): its Composer setup supplies `module.ts` and the service configuration describing the server and database to create. Choose a supported [region](/docs/cli/deploy), then build and deploy a separate test environment from that configured app. This shell example selects `us-east-1`; substitute the region you chose: +Create a development database in your account in [Prisma Console](https://console.prisma.io). The SQL below can be tested before deploying an app. For the app itself, complete [Compute getting started](/docs/compute/getting-started): its Composer setup supplies `module.ts`, named as `entry` in the `composer` section of `prisma.config.ts`, and the service configuration describing the server and database to create. Choose a supported [region](/docs/cli/deploy), then build and deploy a separate test environment from that configured app. This shell example selects `us-east-1`; substitute the region you chose: ```sh export PRISMA_REGION=us-east-1 npx prisma@latest auth login npm run build -npx prisma@latest deploy --stage review +npx prisma@latest deploy --environment review ``` -The deploy prints the service URL and database identifiers; their values depend on your account. `review` names an [isolated deployment stage](/docs/composer/deploying#production-and-stages). Its declared database is separate from production. Verify any manually supplied database URLs too; a stage name does not change their values. Before acceptance tests, ensure the app's booking migrations have been applied to the review database. With `rawPostgres()` or a manually supplied URL, run that migration workflow through the review database's direct connection; deploy does not run it for you. A configured [`postgres()` data contract](/docs/composer/databases) can apply migrations during deployment. The development database's temporary-table demonstration below does not prepare the review database. +The deploy prints the service URL and database identifiers; their values depend on your account. `review` names an [isolated deployment environment](/docs/composer/deploying#environments). Its declared database is separate from production. Verify any manually supplied database URLs too; an environment name does not change their values. Before acceptance tests, ensure the app's booking migrations have been applied to the review database. With `rawPostgres()` or a manually supplied URL, run that migration workflow through the review database's direct connection; deploy does not run it for you. A configured [`postgres()` data contract](/docs/composer/databases) can apply migrations during deployment. The development database's temporary-table demonstration below does not prepare the review database. Use fictional customers and separate credentials. Normal app queries use the pooled connection; this session-based SQL demonstration needs a [direct connection](/docs/postgres/database/connection-pooling) to a development database. Do not run examples against live reservations. @@ -118,7 +118,7 @@ If a request times out after a commit, the browser cannot tell whether it succee In the implemented app's test suite, send two simultaneous booking requests for the same slot in a shared test table and verify that only one succeeds. This is an application acceptance test, separate from the single-session temporary-table demonstration above. Test unauthorized cancellation, a repeated request, a failed notification and rescheduling across the business's relevant time zones. Reload from a second device to check that it sees the same saved state. -After review, build and deploy the approved commit with production credentials and configuration; omit `--stage review` to target production. If the production database already exists, apply its reviewed migrations before releasing the app. For a new database using `rawPostgres()` or a manually supplied URL, provision it with public bookings disabled, obtain its direct connection and apply migrations before accepting customer traffic. A configured `postgres()` data contract can apply migrations during deployment. Verify the production URL and a dedicated test account before opening bookings. Choose a [backup plan](/docs/postgres/database/backups), rehearse restoration into a separate database and decide how to reconstruct bookings made after the latest snapshot. +After review, build and deploy the approved commit with production credentials and configuration; omit `--environment review` to target production. If the production database already exists, apply its reviewed migrations before releasing the app. For a new database using `rawPostgres()` or a manually supplied URL, provision it with public bookings disabled, obtain its direct connection and apply migrations before accepting customer traffic. A configured `postgres()` data contract can apply migrations during deployment. Verify the production URL and a dedicated test account before opening bookings. Choose a [backup plan](/docs/postgres/database/backups), rehearse restoration into a separate database and decide how to reconstruct bookings made after the latest snapshot. ## When should I choose another approach? diff --git a/apps/site/content/answers/postgres/bun-sql-hosting.mdx b/apps/site/content/answers/postgres/bun-sql-hosting.mdx index 20080686b3e..7891dfdfdb2 100644 --- a/apps/site/content/answers/postgres/bun-sql-hosting.mdx +++ b/apps/site/content/answers/postgres/bun-sql-hosting.mdx @@ -5,7 +5,7 @@ summary: "Choose managed Postgres that exposes a PostgreSQL connection URL, then author: "Søren Bramer Schmidt" authorUrl: "https://github.com/sorenbs" date: "2026-10-22" -updatedAt: "2026-10-24" +updatedAt: "2026-11-09" readingTime: "6 min read" faq: - question: "Do I need to install pg or Prisma ORM to use Bun SQL?" @@ -117,7 +117,7 @@ const sql = new SQL({ url: db.url, max: 1, idleTimeout: 10, prepare: false }); The database created by the module is a new deployment resource; it does not reuse the Console database from step 1. Keep that first database for the standalone development check. Apply migrations separately to every new deployment database, using that database's direct connection before testing or serving application queries. `rawPostgres()` supplies the connection but does not apply migrations. Migrating the Console development database in step 3 does not prepare review or production databases. This is an integration excerpt for the configured service, not another standalone script. `service.load()` reads the connections supplied to that service, and `db.url` is its PostgreSQL URL. Keep this client for the instance's lifetime. A manually supplied URL instead follows the schema, binding and server-side read steps in [Service input](/docs/composer/service-input). -Build and test in an [isolated review stage](/docs/composer/deploying#production-and-stages) using a separate database. For first production deployment with `rawPostgres()`, provision the database with customer traffic disabled, obtain its direct connection and apply migrations before serving application queries. For an existing production database, apply reviewed migrations before the app release. Verify the production database identity, schema, pool configuration and [backup plan](/docs/postgres/database/backups) before enabling customers. Review errors and query behavior after release rather than treating a larger pool as the automatic fix for latency. +Build and test in an [isolated review environment](/docs/composer/deploying#environments) using a separate database. For first production deployment with `rawPostgres()`, provision the database with customer traffic disabled, obtain its direct connection and apply migrations before serving application queries. For an existing production database, apply reviewed migrations before the app release. Verify the production database identity, schema, pool configuration and [backup plan](/docs/postgres/database/backups) before enabling customers. Review errors and query behavior after release rather than treating a larger pool as the automatic fix for latency. ## When should I choose another approach? diff --git a/apps/site/content/answers/postgres/customer-order-portal.mdx b/apps/site/content/answers/postgres/customer-order-portal.mdx index c21e2a189d7..2f34ebeb538 100644 --- a/apps/site/content/answers/postgres/customer-order-portal.mdx +++ b/apps/site/content/answers/postgres/customer-order-portal.mdx @@ -5,7 +5,7 @@ summary: "Use managed TypeScript hosting and one shared Postgres database, with author: "Søren Bramer Schmidt" authorUrl: "https://github.com/sorenbs" date: "2026-10-20" -updatedAt: "2026-10-22" +updatedAt: "2026-11-09" readingTime: "7 min read" faq: - question: "Should every customer get a separate Postgres database?" @@ -62,7 +62,7 @@ For a team starting with a TypeScript repository, Prisma Compute makes the app a Create an account-owned development database in [Prisma Console](https://console.prisma.io). Use the [pooled URL](/docs/postgres/database/connecting-to-your-database) for normal application queries and the separate direct URL for the SQL demonstration and administration. Keep both credentials server-side. -Follow the [Compute getting-started guide](/docs/compute/getting-started) to declare the app with Composer and build before deploying. Target an [isolated review stage](/docs/composer/deploying#production-and-stages), for example with `--stage review`, rather than the production default. For a manually configured database URL, give the review app its own scoped value; the word "preview" in a deployment name does not isolate data. +Follow the [Compute getting-started guide](/docs/compute/getting-started) to declare the app with Composer and build before deploying. Target an [isolated review environment](/docs/composer/deploying#environments), for example with `--environment review`, rather than the production default. For a manually configured database URL, give the review app its own scoped value; the word "preview" in a deployment name does not isolate data. ### 2. Model a saved status and a change history diff --git a/apps/site/content/answers/postgres/expo-react-native-backend.mdx b/apps/site/content/answers/postgres/expo-react-native-backend.mdx index aad2afb261a..ce44e468f21 100644 --- a/apps/site/content/answers/postgres/expo-react-native-backend.mdx +++ b/apps/site/content/answers/postgres/expo-react-native-backend.mdx @@ -5,7 +5,7 @@ summary: "Use managed Postgres behind an authenticated HTTPS API for shared Expo author: "Søren Bramer Schmidt" authorUrl: "https://github.com/sorenbs" date: "2026-10-26" -updatedAt: "2026-10-26" +updatedAt: "2026-11-09" readingTime: "6 min read" faq: - question: "Can I put DATABASE_URL in an Expo environment variable?" @@ -58,9 +58,9 @@ Choose the development workspace, project name and region, and use fictional use ### 2. Add the TypeScript API -Follow [Composer getting started](/docs/composer/getting-started) to create an HTTP service, then the [database guide](/docs/composer/databases). Declare `rawPostgres()` in the service and provision that dependency in its module; build the server's PostgreSQL client from `service.load().db.url`. Local development uses a local database, and a cloud stage gets its declared cloud database. If you choose the ORM-typed `postgres()` dependency instead, follow that guide's data-contract and migration workflow. +Follow [Composer getting started](/docs/composer/getting-started) to create an HTTP service, then the [database guide](/docs/composer/databases). Declare `rawPostgres()` in the service and provision that dependency in its module; build the server's PostgreSQL client from `service.load().db.url`. Local development uses a local database, and a cloud environment gets its declared cloud database. If you choose the ORM-typed `postgres()` dependency instead, follow that guide's data-contract and migration workflow. -For `rawPostgres()`, apply the app's migrations to the stage database through its [direct connection](/docs/postgres/database/connecting-to-your-database) before acceptance testing; provisioning a database does not create the app's tables. Follow [deployment and stages](/docs/composer/deploying) to release the API to the intended development stage. Check the printed service URL and database resource before the mobile app uses them. +For `rawPostgres()`, apply the app's migrations to the environment's database through its [direct connection](/docs/postgres/database/connecting-to-your-database) before acceptance testing; provisioning a database does not create the app's tables. Follow [deployment and environments](/docs/composer/deploying#environments) to release the API to the intended development environment. Check the printed service URL and database resource before the mobile app uses them. Verify the identity token using your chosen authentication provider's server-side instructions. Derive the allowed user or organization from that verified session and your membership data. A `userId` sent by the phone is an input to check, not evidence that the caller owns that user's records. diff --git a/apps/site/content/answers/postgres/spreadsheet-import-hosting.mdx b/apps/site/content/answers/postgres/spreadsheet-import-hosting.mdx index 7e1db4fbdba..b36d35771dc 100644 --- a/apps/site/content/answers/postgres/spreadsheet-import-hosting.mdx +++ b/apps/site/content/answers/postgres/spreadsheet-import-hosting.mdx @@ -5,13 +5,13 @@ summary: "Host the TypeScript server separately from its saved customer records, author: "Søren Bramer Schmidt" authorUrl: "https://github.com/sorenbs" date: "2026-10-23" -updatedAt: "2026-10-23" +updatedAt: "2026-11-09" readingTime: "7 min read" faq: - question: "Should I keep the uploaded spreadsheet as well as its imported rows?" answer: "Keep the source file when reconciliation or audit requirements need it, using access-controlled object storage and a defined retention period. Store the file reference and import result in Postgres. A saved spreadsheet does not replace the application's customer records." - question: "Does redeploying Prisma Compute delete imported records?" - answer: "A normal deployment of the same declared application reuses its database resource. Imported rows remain there unless application code, migrations or resource changes remove them. Verify the project, stage and database identifiers before release; deploying a different stage creates a separate environment." + answer: "A normal deployment of the same declared application reuses its database resource. Imported rows remain there unless application code, migrations or resource changes remove them. Verify the project, environment and database identifiers before release; deploying to a different environment name creates a separate copy of the app." - question: "Can I import Excel files with PostgreSQL COPY?" answer: "COPY accepts supported text formats such as CSV, not an Excel workbook. Parse the workbook with an appropriate application library or export a selected sheet to CSV, then validate columns and values before inserting customer records." - question: "Do I need Prisma ORM for an import app?" @@ -58,7 +58,7 @@ For a new TypeScript business app, Prisma Compute gives the team one project in ### 1. Connect a review app to a separate database -Use the [Next.js guide](/docs/guides/frameworks/nextjs) for a new app, or [port the existing server](/docs/composer/porting-an-app) by adding Composer's module and service declarations. These TypeScript files describe the resources the app needs. Build the application before deploying it to an [isolated review stage](/docs/composer/deploying#production-and-stages). +Use the [Next.js guide](/docs/guides/frameworks/nextjs) for a new app, or [port the existing server](/docs/composer/porting-an-app) by adding Composer's module and service declarations. These TypeScript files describe the resources the app needs. Build the application before deploying it to an [isolated review environment](/docs/composer/deploying#environments). The [database dependency guide](/docs/composer/databases) has two paths: `rawPostgres()` supplies a connection URL for your own client; `postgres()` can connect a Prisma ORM data contract with deploy-time migrations. A raw connection leaves schema migrations with your existing tooling. Do not put a database reset or spreadsheet seed into every build. @@ -105,7 +105,7 @@ DROP TABLE import_customer_demo; ### 4. Test a retry and a release -Import a file, retry the same job after a simulated lost response, and check the accepted/rejected counts against saved records. Then deploy a code change to the same review stage and verify the database identifier and those records again. Test an unauthorized account, malformed dates and a file with conflicting customer identifiers as well. +Import a file, retry the same job after a simulated lost response, and check the accepted/rejected counts against saved records. Then deploy a code change to the same review environment and verify the database identifier and those records again. Test an unauthorized account, malformed dates and a file with conflicting customer identifiers as well. Choose a [backup policy](/docs/postgres/database/backups) and [practice recovery](/postgres/practice-database-recovery) before the importer becomes the business's record system. A code rollback cannot reverse committed customer updates. Keep any migration that changes existing data reviewable and test it against a disposable copy first. diff --git a/apps/site/src/components/brand/step-mocks.tsx b/apps/site/src/components/brand/step-mocks.tsx index 78f737f2873..4aef7e1d952 100644 --- a/apps/site/src/components/brand/step-mocks.tsx +++ b/apps/site/src/components/brand/step-mocks.tsx @@ -91,7 +91,7 @@ export function IterateMock({ className }: { className?: string }) {

- $ npx prisma deploy module.ts + $ npx prisma deploy

diff --git a/apps/site/src/components/landing/content.ts b/apps/site/src/components/landing/content.ts index b7ed78c62d5..916dbaf6bd7 100644 --- a/apps/site/src/components/landing/content.ts +++ b/apps/site/src/components/landing/content.ts @@ -114,7 +114,7 @@ export type LandingContent = { const DEPLOY_STOP: ProductTourStop = { label: "Deploy", caption: - "One command, npx prisma deploy module.ts, provisions the app and its Prisma Postgres database and applies your migrations.", + "One command, npx prisma deploy, provisions the app and its Prisma Postgres database and applies your migrations.", illustration: "deployLog", }; @@ -203,7 +203,7 @@ export const computeLanding: LandingContent = { { question: "Can I deploy an app I already have?", answer: - "Yes, if it is a TypeScript service for Node.js, Bun or Next.js. Add a short declaration (a service.ts and a module.ts) around the server code you already have, then run npx prisma deploy module.ts. The docs include a prompt your coding agent can write the declaration from.", + "Yes, if it is a TypeScript service for Node.js, Bun or Next.js. Add a declaration (a service.ts and a module.ts) around the server code you already have, name module.ts as the entry in the composer section of prisma.config.ts, then run npx prisma deploy. The docs include a prompt your coding agent can write the declaration from.", }, { question: "What does it cost?", diff --git a/apps/site/src/components/product/content/compute.ts b/apps/site/src/components/product/content/compute.ts index dbccb86dfec..1546ca9fd30 100644 --- a/apps/site/src/components/product/content/compute.ts +++ b/apps/site/src/components/product/content/compute.ts @@ -78,7 +78,7 @@ export const computeContent: ProductPageContent = { { label: "Connect", caption: - "Deploy from your machine with npx prisma deploy module.ts, or connect the GitHub repo and add the deploy workflow to deploy on every push.", + "Deploy from your machine with npx prisma deploy, or connect the GitHub repo and add the deploy workflow to deploy on every push.", illustration: "repoConnect", }, { @@ -170,7 +170,7 @@ export const computeContent: ProductPageContent = { { question: "Can I host my existing GitHub repo with a TypeScript frontend and Node API here?", answer: - "Yes, when the frontend and the API are TypeScript services built for Node.js, Bun or Next.js. Add a Composer declaration around the server code you already have (a service.ts per service and one module.ts); the porting guide in the docs has a prompt your coding agent can write it from. Run your build, then deploy with npx prisma deploy module.ts. For deploy on push, connect the repository and add the prisma/cloud-deploy-action workflow; from then on every feature branch gets a preview with its own declared databases. For the same workflow on other hosts, see [how to host a test version of your app without replacing production](/blog/host-a-test-version-without-replacing-production).", + "Yes, when the frontend and the API are TypeScript services built for Node.js, Bun or Next.js. Add a Composer declaration around the server code you already have (a service.ts per service and one module.ts, named as the entry in the composer section of prisma.config.ts); the porting guide in the docs has a prompt your coding agent can write it from. Run your build, then deploy with npx prisma deploy. For deploy on push, connect the repository and add the prisma/cloud-deploy-action workflow; from then on every feature branch gets a preview with its own declared databases. For the same workflow on other hosts, see [how to host a test version of your app without replacing production](/blog/host-a-test-version-without-replacing-production).", }, { question: "What does Prisma Compute not do?", diff --git a/apps/site/src/components/product/illustrations/deploy-log.tsx b/apps/site/src/components/product/illustrations/deploy-log.tsx index 6004055575c..f11ab1d58e3 100644 --- a/apps/site/src/components/product/illustrations/deploy-log.tsx +++ b/apps/site/src/components/product/illustrations/deploy-log.tsx @@ -48,7 +48,7 @@ export function DeployLog() {

$ - prisma deploy module.ts + prisma deploy

{STEPS.map(({ label, detail, time }) => ( diff --git a/apps/site/src/components/product/illustrations/deployments.tsx b/apps/site/src/components/product/illustrations/deployments.tsx index 1583710b9c9..494b6b7dd1d 100644 --- a/apps/site/src/components/product/illustrations/deployments.tsx +++ b/apps/site/src/components/product/illustrations/deployments.tsx @@ -108,7 +108,7 @@ export function Deployments() {

$ - prisma deploy module.ts + prisma deploy

diff --git a/apps/site/src/components/product/illustrations/repo-connect.tsx b/apps/site/src/components/product/illustrations/repo-connect.tsx index 41caf0fe2ac..416104d7f0a 100644 --- a/apps/site/src/components/product/illustrations/repo-connect.tsx +++ b/apps/site/src/components/product/illustrations/repo-connect.tsx @@ -75,7 +75,7 @@ export function RepoConnect() {
- $ npx prisma deploy module.ts + $ npx prisma deploy
diff --git a/apps/site/src/components/sections/comparison-cards.tsx b/apps/site/src/components/sections/comparison-cards.tsx index 4bb061422f9..4cc098feda3 100644 --- a/apps/site/src/components/sections/comparison-cards.tsx +++ b/apps/site/src/components/sections/comparison-cards.tsx @@ -166,10 +166,10 @@ export function LiveCard() { feature/checkout

- + $ - npx prisma deploy module.ts - + npx prisma deploy --environment feature/checkout +