[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill-prisma-prisma-next-runtime":3,"mdc-ct9ehq-key":35,"related-repo-prisma-prisma-next-runtime":7695,"related-org-prisma-prisma-next-runtime":7788},{"slug":4,"name":4,"fn":5,"description":6,"org":7,"tags":11,"stars":23,"repoUrl":24,"updatedAt":25,"license":26,"forks":27,"topics":28,"repo":31,"sourceUrl":33,"mdContent":34},"prisma-next-runtime","configure Prisma Next runtime and database connections","Wire the Prisma Next runtime — `db.ts` setup using `postgres\u003CContract>(...)` from `@prisma-next\u002Fpostgres\u002Fruntime`, `sqlite\u003CContract>(...)` from `@prisma-next\u002Fsqlite\u002Fruntime`, or `mongo\u003CContract>(...)` from `@prisma-next\u002Fmongo\u002Fruntime`; middleware composition (telemetry from `@prisma-next\u002Fmiddleware-telemetry`; lints and budgets), `DATABASE_URL` config, per-environment branching, switching between Postgres, SQLite, and Mongo façades. Use for db.ts, postgres(), sqlite(), mongo(), middleware, telemetry, lints, budgets, DATABASE_URL, .env, connection pool, poolOptions, dev vs prod config, transactions, db.transaction, read replicas, multi-database, script won't exit, hangs, close connection, db.end, db.close, pool.end, [Symbol.asyncDispose], await using.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},"prisma","Prisma","https:\u002F\u002Fpexgzepcugksgbtrxkhf.supabase.co\u002Fstorage\u002Fv1\u002Fobject\u002Fpublic\u002Forg-logos\u002Fprisma.png",[12,16,19,20],{"name":13,"slug":14,"type":15},"Next.js","next-js","tag",{"name":17,"slug":18,"type":15},"Database","database",{"name":9,"slug":8,"type":15},{"name":21,"slug":22,"type":15},"PostgreSQL","postgresql",415,"https:\u002F\u002Fgithub.com\u002Fprisma\u002Fprisma-next","2026-07-17T05:32:05.347316",null,15,[29,30],"loggy-core","loggy-terminal",{"repoUrl":24,"stars":23,"forks":27,"topics":32,"description":26},[29,30],"https:\u002F\u002Fgithub.com\u002Fprisma\u002Fprisma-next\u002Ftree\u002FHEAD\u002Fskills\u002Fprisma-next-runtime","---\nname: prisma-next-runtime\ndescription: Wire the Prisma Next runtime — `db.ts` setup using `postgres\u003CContract>(...)` from `@prisma-next\u002Fpostgres\u002Fruntime`, `sqlite\u003CContract>(...)` from `@prisma-next\u002Fsqlite\u002Fruntime`, or `mongo\u003CContract>(...)` from `@prisma-next\u002Fmongo\u002Fruntime`; middleware composition (telemetry from `@prisma-next\u002Fmiddleware-telemetry`; lints and budgets), `DATABASE_URL` config, per-environment branching, switching between Postgres, SQLite, and Mongo façades. Use for db.ts, postgres(), sqlite(), mongo(), middleware, telemetry, lints, budgets, DATABASE_URL, .env, connection pool, poolOptions, dev vs prod config, transactions, db.transaction, read replicas, multi-database, script won't exit, hangs, close connection, db.end, db.close, pool.end, [Symbol.asyncDispose], await using.\n---\n\n# Prisma Next — Runtime (`db.ts` Wiring)\n\n> **Edit your data contract. Prisma handles the rest.**\n\nThis skill covers the **runtime entry point** — `db.ts` — and how to compose the database client with extensions, middleware, and environment configuration.\n\n## When to Use\n\n- User is wiring up `db.ts` for the first time (post-init).\n- User wants to add middleware (telemetry, lints, budgets, custom).\n- User wants per-environment config (dev vs prod, multi-region).\n- User wants to switch between the Postgres, SQLite, and Mongo façades.\n- User wants to wrap operations in `db.transaction(...)` (Postgres and SQLite).\n- User is running a one-off script (`tsx my-script.ts`, Node CLI, CI task) and the process won't exit after queries finish, or they need script teardown (`db.close()`, `await using`).\n- User mentions: *db.ts, postgres(), mongo(), middleware, telemetry, lints, budgets, DATABASE_URL, .env, connection pool, poolOptions, dev vs prod, transactions, read replicas, multi-database, script won't exit, hangs, db.close, db.end, close connection, pool.end, await using*.\n\n## When Not to Use\n\n- User wants to write queries → `prisma-next-queries`.\n- User is on Supabase — the `supabase()` role-first factory, `asUser(jwt)` \u002F `asAnon()` \u002F `asServiceRole()`, JWT config, RLS → `prisma-next-supabase`.\n- User wants to edit the contract → `prisma-next-contract`.\n- User wants to wire Prisma Next into a build tool (Vite plugin, Next.js, …) → `prisma-next-build`.\n- User wants to debug a connection \u002F runtime error → `prisma-next-debug`.\n- User wants to file a bug or feature request → `prisma-next-feedback`.\n\n## Key Concepts\n\n- **`db.ts` is the runtime entry point.** Imports the runtime factory from the `@prisma-next\u002F\u003Ctarget>` façade (`@prisma-next\u002Fpostgres\u002Fruntime`, `@prisma-next\u002Fsqlite\u002Fruntime`, or `@prisma-next\u002Fmongo\u002Fruntime`), the contract artefacts (`contract.json` + the `Contract` type from `contract.d.ts`), and any middleware. Exports a `db` value the rest of your app imports.\n- **The façade's runtime factory is the only surface user-authored `db.ts` imports from.** Each factory is a *default* export. For Postgres: `import postgres from '@prisma-next\u002Fpostgres\u002Fruntime'`; SQLite: `import sqlite from '@prisma-next\u002Fsqlite\u002Fruntime'`; Mongo: `import mongo from '@prisma-next\u002Fmongo\u002Fruntime'`. The factory signature is `\u003CTarget>\u003CContract>(options)` — a single type parameter (the `Contract` type from `contract.d.ts`), and one options object.\n- **Lazy connect.** The factory does not connect to the database synchronously. Static query surfaces (`db.sql`, `db.orm`) are available immediately; the driver \u002F pool is instantiated on the first call that needs a runtime (or when you explicitly call `await db.connect({ url })`). This is why `db.ts` can be imported in modules that load before the env is ready.\n- **Middleware composes in order.** The first middleware in the `middleware: [...]` array runs *outermost* — it sees the operation first on the way in and last on the way out. Telemetry first means budget \u002F lint failures show up inside telemetry spans.\n- **`prisma-next.config.ts` vs `.env`.** The config (`defineConfig({ contract, db, extensions, migrations })`) is for static project shape: contract path, installed extensions, migrations directory, default connection string. `.env` is for per-environment values (`DATABASE_URL`, secrets). The config reads `.env` automatically via `dotenv\u002Fconfig`. Hardcoding `DATABASE_URL` in the config file leaks credentials and bypasses per-env overrides.\n- **Build-system \u002F dev-server integration is a separate skill.** `vite dev` auto-emit lives in `prisma-next-build`. The runtime side (this skill) reads `contract.json` \u002F `contract.d.ts` regardless of how they got onto disk, so the two skills compose cleanly.\n\n## Workflow — Basic `db.ts`\n\nThe concept: `db.ts` is the seam between the emitted contract artefacts (target-shaped) and the runtime that executes queries against them. Three imports are load-bearing — the runtime factory, the `Contract` type (so the static query surfaces are typed), and the JSON artefact (so the runtime validates the structure at construct time).\n\n`init` scaffolds something like this (for `--target postgres`):\n\n```typescript\n\u002F\u002F src\u002Fprisma\u002Fdb.ts\nimport postgres from '@prisma-next\u002Fpostgres\u002Fruntime';\nimport type { Contract } from '.\u002Fcontract.d';\nimport contractJson from '.\u002Fcontract.json' with { type: 'json' };\n\nexport const db = postgres\u003CContract>({\n  contractJson,\n  url: process.env['DATABASE_URL'],\n});\n```\n\n(`init` currently scaffolds at `prisma\u002Fdb.ts` instead — see TML-2532 in `prisma-next-quickstart`. The canonical path is `src\u002Fprisma\u002Fdb.ts`; the rest of `src\u002F` imports from `.\u002Fprisma\u002Fdb` or `..\u002Fprisma\u002Fdb` depending on depth.)\n\nThree things to know:\n\n- **`\u003CContract>` type parameter is load-bearing.** Without it, the static surfaces collapse to a generic shape and you lose autocomplete on model names. Always import `Contract` from the emitted `.\u002Fcontract.d.ts`.\n- **`with { type: 'json' }` is required.** Node's ESM JSON-import-attribute spec. Without it, the import errors.\n- **`url` is optional at construct time.** If `DATABASE_URL` is not set when `db.ts` loads, the factory still returns a client; you can call `await db.connect({ url })` later. The factory throws lazily — only when a runtime is actually needed.\n\nThe Mongo façade has the same construction shape — `import mongo from '@prisma-next\u002Fmongo\u002Fruntime'` — and the same `db.connect(...)` \u002F `db.close()` lifecycle methods. **The Mongo façade does not expose `db.transaction(...)`.** See *What Prisma Next doesn't do yet* for the workaround. **The ORM surface differs in one place: keys.** On Mongo, `db.orm` is keyed by the collection's storage name (from `@@map(...)`, or the lowercased model name if no `@@map` is set), not by the PSL model name — so `model User { … @@map(\"users\") }` is reached at `db.orm.users`, not `db.orm.User`. The SQL builder lane (`db.sql.\u003Ctable>`) doesn't exist on Mongo at all (`db.sql` is `undefined`). See `prisma-next-queries` § *MongoDB ORM addressing* for the full rule and a rewrite recipe for SQL-target examples.\n\n## Workflow — Running as a script (teardown)\n\nThe concept: short scripts that connect, query, then expect the process to exit will **hang on Postgres** because the façade-owned `pg.Pool` keeps Node's event loop alive. The data round-trip succeeds; the script never exits. Call `await db.close()` before the script returns (or use `await using` **at the top of a script module** so teardown runs when the module exits — see the block-scope warning below for why this matters).\n\n**Plain shape** — export `db` from `db.ts`, import it in the script, close at the end:\n\n```typescript\n\u002F\u002F src\u002Fscripts\u002Fhello.ts\nimport { db } from '..\u002Fprisma\u002Fdb';\n\nconst created = await db.orm.User.create({ email: 'alice@example.com', name: 'Alice' });\nconst read = await db.orm.User.first();\nconsole.log({ created, read });\n\nawait db.close();\n```\n\n**TS 5.2+ idiomatic shape** — construct the client at the **top of a script module** and let `[Symbol.asyncDispose]` call `close()` when the module exits:\n\n```typescript\n\u002F\u002F src\u002Fscripts\u002Fhello.ts — top-level await in a script module\nimport postgres from '@prisma-next\u002Fpostgres\u002Fruntime';\nimport type { Contract } from '..\u002Fprisma\u002Fcontract.d';\nimport contractJson from '..\u002Fprisma\u002Fcontract.json' with { type: 'json' };\n\nawait using db = postgres\u003CContract>({ contractJson, url: process.env.DATABASE_URL! });\n\nconst user = await db.orm.User.first();\nconsole.log(user);\n\u002F\u002F db.close() runs automatically when the script module exits.\n```\n\n### `await using` is **block-scoped** — do not put it inside a request handler\n\nThis is the most important rule in this section. `await using db = postgres(...)` disposes when the *enclosing block* exits. In a script module, that block is the module body and disposal fires at process exit — fine. In a request handler, the enclosing block is the handler function, so disposal fires **after every request** — a fresh `pg.Pool` per call, TCP-connect storm, hot loop tearing connections up and down.\n\n```typescript\n\u002F\u002F DO NOT do this — closes the pool after every request.\napp.get('\u002Fusers', async (req, res) => {\n  await using db = postgres\u003CContract>({ contractJson, url: process.env.DATABASE_URL! });\n  const users = await db.orm.User.all();\n  res.json(users);\n});\n```\n\nThe right server pattern is a **module-level singleton** in `db.ts`, imported by handlers, never closed during the process lifetime:\n\n```typescript\n\u002F\u002F src\u002Fprisma\u002Fdb.ts — constructed once, lives for the process\nexport const db = postgres\u003CContract>({ contractJson, url: process.env.DATABASE_URL });\n\n\u002F\u002F src\u002Froutes\u002Fusers.ts\nimport { db } from '..\u002Fprisma\u002Fdb';\n\napp.get('\u002Fusers', async (req, res) => {\n  const users = await db.orm.User.all();\n  res.json(users);\n});\n```\n\nServers (HTTP handlers, workers in a request loop) **do not call `db.close()`** at all in steady state. The pool stays open for the process lifetime. `db.close()` and `await using` are for short-lived scripts — `tsx my-script.ts`, Node CLI commands, CI tasks, one-off seed runs — not for code that runs inside a request loop.\n\n**Semantics:**\n\n- **`close()` is idempotent.** Calling it twice is a no-op.\n- **`close()` is terminal.** There is no reconnect on a closed `db` — construct a new client if you need another connection. After close, `db.runtime()`, `db.connect(...)`, `db.transaction(...)`, and `db.prepare(...)` reject with `Error('\u003Ctarget> client is closed')` (e.g. `'Postgres client is closed'`, `'SQLite client is closed'`, `'Mongo client is closed'`).\n- **`close()` does not abort in-flight queries.** `await` outstanding work before calling `close()`. Async iterators from `db.runtime().execute(plan)` and `PreparedStatement` handles held after `close()` fail on their next call.\n- **Ownership.** `close()` releases only what the façade constructed (`pg.Pool` from `{ url }`, `MongoClient` from `{ url }` \u002F `{ uri, dbName }`, SQLite handle from `{ path }`). If you supplied your own `pg.Pool` \u002F `pg.Client` (Postgres `pg:` option), `mongodb.MongoClient` (Mongo `mongoClient:` option), or a pre-built `binding`, `db.close()` does **not** touch those — you own their lifecycle.\n\n**`db.end()` does not exist.** The universal `node-postgres` name is `pool.end()` on a `pg.Pool`; the Prisma Next runtime client is not a `pg.Pool`. The right call is `await db.close()`.\n\n## Workflow — Telemetry middleware\n\nThe concept: telemetry middleware sees every operation and emits a structured event for each (start, success, error). Pair the events with your observability stack's collector.\n\n```typescript\nimport postgres from '@prisma-next\u002Fpostgres\u002Fruntime';\nimport { createTelemetryMiddleware } from '@prisma-next\u002Fmiddleware-telemetry';\nimport type { Contract } from '.\u002Fcontract.d';\nimport contractJson from '.\u002Fcontract.json' with { type: 'json' };\n\nexport const db = postgres\u003CContract>({\n  contractJson,\n  url: process.env['DATABASE_URL'],\n  middleware: [\n    createTelemetryMiddleware({\n      onEvent: (event) => {\n        \u002F\u002F forward to your collector, log, etc.\n      },\n    }),\n  ],\n});\n```\n\n`createTelemetryMiddleware` is shipped as a separate user-installable package (`@prisma-next\u002Fmiddleware-telemetry`), not as a `\u002Fmiddleware` subpath of the postgres façade. Install it directly. Run `pnpm ls @prisma-next\u002Fmiddleware-telemetry` to confirm it's on the lockfile.\n\n## Workflow — Lints and budgets middleware\n\nThe concept: lints catch authoring mistakes that survive type-check (e.g. `DELETE` without a `WHERE`, `SELECT` without a `LIMIT` on a large table); budgets enforce row-count and latency ceilings at runtime. Both surface findings through the structured-error envelope so an agent can branch on the code.\n\nThese ship in the underlying SQL runtime package (`@prisma-next\u002Fsql-runtime`) and are *not* yet re-exported from the postgres façade — see *What Prisma Next doesn't do yet*. The example apps under `examples\u002Fprisma-next-demo\u002Fsrc\u002Fprisma\u002Fdb.ts` show the canonical import.\n\n```typescript\nimport postgres from '@prisma-next\u002Fpostgres\u002Fruntime';\nimport { budgets, lints } from '@prisma-next\u002Fsql-runtime';\nimport type { Contract } from '.\u002Fcontract.d';\nimport contractJson from '.\u002Fcontract.json' with { type: 'json' };\n\nexport const db = postgres\u003CContract>({\n  contractJson,\n  url: process.env['DATABASE_URL'],\n  middleware: [\n    lints({\n      severities: {\n        selectStar: 'warn',\n        noLimit: 'error',\n        deleteWithoutWhere: 'error',\n        updateWithoutWhere: 'error',\n        readOnlyMutation: 'error',\n      },\n    }),\n    budgets({\n      maxRows: 10_000,\n      defaultTableRows: 10_000,\n      tableRows: { user: 10_000, post: 50_000 },\n      maxLatencyMs: 1_000,\n      severities: { rowCount: 'error', latency: 'warn' },\n    }),\n  ],\n});\n```\n\nFor the full option surface, read the source: `packages\u002F2-sql\u002F5-runtime\u002Fsrc\u002Fmiddleware\u002Flints.ts` and `...\u002Fbudgets.ts`. The `severities` keys (`selectStar`, `noLimit`, `deleteWithoutWhere`, `updateWithoutWhere`, `readOnlyMutation` for lints; `rowCount`, `latency` for budgets) are the source of truth; do not extrapolate to a key that ripgrep can't find.\n\n## Workflow — Compose multiple middleware\n\n```typescript\nmiddleware: [\n  createTelemetryMiddleware({ onEvent }),  \u002F\u002F outermost — sees all sub-failures as inner errors\n  lints({ severities: { noLimit: 'error' } }),\n  budgets({ maxLatencyMs: 5_000 }),         \u002F\u002F innermost — runs closest to the driver\n],\n```\n\nOrder matters: outermost wraps. Telemetry first means budget \u002F lint failures are captured as spans (the agent can correlate the lint code with the operation in the same trace).\n\n## Workflow — Configure the connection\n\nThe concept: the runtime takes one of three binding shapes — `url`, `pg` (a pre-constructed `pg.Pool` or `pg.Client`), or `binding` (an explicit kind tag). They're mutually exclusive. The `pg` form is for projects that already manage their own pool (e.g. a Lambda layer); `url` is the default. Pool tuning is `poolOptions.connectionTimeoutMillis` \u002F `poolOptions.idleTimeoutMillis` — *not* `driverOptions`.\n\n```typescript\n\u002F\u002F Default — URL string, factory constructs the pool.\npostgres\u003CContract>({\n  contractJson,\n  url: process.env['DATABASE_URL'],\n  poolOptions: {\n    connectionTimeoutMillis: 20_000,\n    idleTimeoutMillis: 30_000,\n  },\n});\n\n\u002F\u002F BYO pool — pass a pg.Pool you already created.\nimport { Pool } from 'pg';\nconst pool = new Pool({ connectionString: process.env['DATABASE_URL'] });\npostgres\u003CContract>({ contractJson, pg: pool });\n```\n\nThe `url` and `pg` keys are mutually exclusive at the type level; passing both errors.\n\n`DATABASE_URL` lives in `.env`. The CLI reads it for emit \u002F verify \u002F migration commands; the runtime reads it through `process.env` at `db.ts` load time.\n\n## Workflow — Per-environment config (dev vs prod)\n\nThe concept: one `DATABASE_URL` per environment; the rest of the `db.ts` shape is the same. For middleware divergence (e.g. strict lints in dev only), branch in `db.ts` on `process.env['NODE_ENV']`.\n\n```typescript\nconst isProd = process.env['NODE_ENV'] === 'production';\n\nexport const db = postgres\u003CContract>({\n  contractJson,\n  url: process.env['DATABASE_URL'],\n  middleware: isProd\n    ? [createTelemetryMiddleware({ onEvent })]\n    : [\n        createTelemetryMiddleware({ onEvent }),\n        lints({ severities: { noLimit: 'error', deleteWithoutWhere: 'error' } }),\n      ],\n});\n```\n\n`.env` for local; the deploy platform's secrets for prod. Never commit `.env`.\n\n## Workflow — Transactions\n\nThe concept applies to **Postgres and SQLite**. `db.transaction(fn)` opens a transaction, gives the callback a `tx` context with the same `sql` \u002F `orm` surfaces as `db`, and commits on successful return \u002F rolls back on any thrown error. Inside the callback, use `tx.sql` and `tx.orm` instead of `db.sql` \u002F `db.orm` so the writes ride the transaction. The Mongo façade does not expose `db.transaction(...)`.\n\n```typescript\nawait db.transaction(async (tx) => {\n  const user = await tx.orm.User.create({ email: 'alice@example.com' });\n  await tx.orm.Post.create({ userId: user.id, title: 'hello' });\n  \u002F\u002F If either call throws, both inserts roll back.\n});\n```\n\nThe callback returns whatever you return from it — the transaction wrapper passes it through. The `tx` object exposes `execute(plan)` for SQL-builder plans inside the transaction.\n\n## Workflow — Switch between Postgres, SQLite, and Mongo\n\nThe concept: the façade selection is baked into `db.ts` (`@prisma-next\u002Fpostgres`, `@prisma-next\u002Fsqlite`, or `@prisma-next\u002Fmongo`) and `prisma-next.config.ts` (which `defineConfig` you import from). To switch a project's target, re-run `prisma-next init` in the same directory and pick the other target — the init flow detects the existing scaffold and prompts to reinit (`--force` skips the prompt). PN re-scaffolds `prisma-next.config.ts` and `db.ts` for the new façade. The contract source needs to be re-authored for the new target's idioms (Mongo expresses nested documents; Postgres\u002FSQLite express relations).\n\nAfter the switch (Mongo):\n\n```typescript\n\u002F\u002F src\u002Fprisma\u002Fdb.ts (Mongo)\nimport mongo from '@prisma-next\u002Fmongo\u002Fruntime';\nimport type { Contract } from '.\u002Fcontract.d';\nimport contractJson from '.\u002Fcontract.json' with { type: 'json' };\n\nexport const db = mongo\u003CContract>({ contractJson, url: process.env['DATABASE_URL'] });\n```\n\nSQLite:\n\n```typescript\n\u002F\u002F src\u002Fprisma\u002Fdb.ts (SQLite)\nimport sqlite from '@prisma-next\u002Fsqlite\u002Fruntime';\nimport type { Contract } from '.\u002Fcontract.d';\nimport contractJson from '.\u002Fcontract.json' with { type: 'json' };\n\nexport const db = sqlite\u003CContract>({ contractJson, path: 'app.db' });\n```\n\n`path` is optional at construct time (you can call `db.connect({ path })` later); omit it and the façade still returns a client. The SQLite façade exposes the same `db.sql`, `db.orm`, `db.transaction(...)`, `db.close()`, and `[Symbol.asyncDispose]` surfaces as Postgres. The Mongo façade shares `db.orm`, `db.close()`, and `[Symbol.asyncDispose]` but has no `db.sql` and no `db.transaction(...)`.\n\nThe `db.sql` \u002F `db.orm` surfaces stay the same in name; the operators each surface exposes are target-shaped (Mongo has no `JOIN`).\n\n## Workflow — Build-system \u002F dev-server integration\n\nIf you want contract artefacts to re-emit automatically while the dev server is running (instead of running `prisma-next contract emit` by hand each time the contract source changes), reach for the build-tool plugin from `prisma-next-build`:\n\n- **Vite**: install `@prisma-next\u002Fvite-plugin-contract-emit` and register `prismaVitePlugin('prisma-next.config.ts')` in `vite.config.ts`.\n- **Next.js, Webpack, esbuild, Rollup, Turbopack**: no first-party plugin yet — the workaround is a `prebuild` script that runs `prisma-next contract emit`. See `prisma-next-build` for the walkthrough.\n\nThe runtime side (this skill) is the same regardless: `db.ts` reads `contract.json` + `contract.d.ts` from disk. The build-system plugin's job is to keep those files current during development.\n\n## Common Pitfalls\n\n1. **Hardcoding `DATABASE_URL` in `prisma-next.config.ts`.** Leaks credentials; bypasses per-environment overrides. Use `.env`.\n2. **Omitting the `\u003CContract>` type parameter** in `postgres\u003CContract>(...)`. Without it, static surfaces collapse to a generic shape and you lose autocomplete for models. There is no second type parameter — the older two-param signature (`postgres\u003CContract, TypeMaps>`) is gone.\n3. **Forgetting `with { type: 'json' }` on the contract import.** Required by Node's ESM JSON-import-attribute spec.\n4. **Middleware order matters.** Outermost wraps. Put telemetry first if you want it to capture inner-middleware errors.\n5. **Importing middleware from a non-existent façade subpath.** `@prisma-next\u002Fpostgres\u002Fmiddleware` does *not* exist. Telemetry comes from `@prisma-next\u002Fmiddleware-telemetry`; lints \u002F budgets come from `@prisma-next\u002Fsql-runtime` today (see *What Prisma Next doesn't do yet*).\n6. **Confabulating lint \u002F budget option names.** Lints take `severities` (with the five keys above), not `requireWhere` \u002F `maxRowsWithoutLimit`. Budgets use `maxLatencyMs` (not `maxDurationMs`) plus `maxRows` \u002F `defaultTableRows` \u002F `tableRows`. When in doubt, read the source.\n7. **Switching targets without re-emitting.** The contract artefacts are target-shaped; emit after the target change.\n8. **Script hangs after queries finish on Postgres.** The `pg.Pool` keeps Node's event loop alive. Solution: `await db.close()` before the script returns, or `await using db = postgres\u003CContract>(...)` at the top of a script module. Do not put `await using db = postgres(...)` inside a request handler — it's block-scoped and would close the pool after every request. The right server pattern is a module-level singleton in `db.ts` that lives for the process lifetime.\n\n## What Prisma Next doesn't do yet\n\n- **`@prisma-next\u002Fpostgres\u002Fmiddleware` subpath.** The postgres façade re-exports the runtime factory (`.\u002Fruntime`), config (`.\u002Fconfig`), contract-builder (`.\u002Fcontract-builder`), control (`.\u002Fcontrol`), family (`.\u002Ffamily`), target (`.\u002Ftarget`), and serverless (`.\u002Fserverless`) — but not middleware. Today's workaround: import `lints` and `budgets` from `@prisma-next\u002Fsql-runtime`, and `createTelemetryMiddleware` from `@prisma-next\u002Fmiddleware-telemetry`. File additional gaps you hit via `prisma-next-feedback`.\n- **Multi-database routing \u002F read replicas.** Prisma Next doesn't ship a built-in primary\u002Freplica router or shard-aware client. Workaround: configure separate `db.ts` instances per data store and call the right one in your application code. If you need first-class multi-database routing, file a feature request via the `prisma-next-feedback` skill.\n- **Connection pooling as a first-class config field.** `poolOptions.connectionTimeoutMillis` and `poolOptions.idleTimeoutMillis` are wired through, but the rest of `pg.Pool`'s tuning surface (max connections, `allowExitOnIdle`, ssl options, …) is not exposed by name. Workaround: construct the `pg.Pool` yourself and pass it via `pg:`. If you need more pool fields surfaced on the façade, file a feature request via the `prisma-next-feedback` skill.\n- **Query logger middleware as a built-in.** Prisma Next doesn't ship a \"log every query\" middleware. Workaround: write a small custom middleware that wraps each operation and logs; or use `createTelemetryMiddleware` and log inside the `onEvent` callback. If you need a built-in query log, file a feature request via the `prisma-next-feedback` skill.\n\n## Reference Files\n\nThis skill is intentionally body-only; `prisma-next init --help`, the `defineConfig` factory in `packages\u002F3-extensions\u002Fpostgres\u002Fsrc\u002Fconfig\u002Fdefine-config.ts`, the `postgres()` factory in `packages\u002F3-extensions\u002Fpostgres\u002Fsrc\u002Fruntime\u002Fpostgres.ts`, and the middleware sources in `packages\u002F2-sql\u002F5-runtime\u002Fsrc\u002Fmiddleware\u002F{lints,budgets}.ts` are the authoritative surfaces for option-level detail. When in doubt, read the source.\n\n## Checklist\n\n- [ ] `db.ts` imports the runtime factory from `@prisma-next\u002F\u003Ctarget>\u002Fruntime` (`postgres`, `sqlite`, or `mongo`) and the `Contract` type from `.\u002Fcontract.d`.\n- [ ] `with { type: 'json' }` on the contract JSON import.\n- [ ] `\u003CContract>` is the single type parameter on `postgres\u003CContract>(...)` (no second parameter).\n- [ ] `DATABASE_URL` lives in `.env`, not in `prisma-next.config.ts`.\n- [ ] Middleware ordered intentionally (telemetry outermost typically).\n- [ ] `lints` \u002F `budgets` use the verified option keys (`severities`, `maxLatencyMs`, `maxRows`, `tableRows`).\n- [ ] Per-env divergence (if any) gated by `NODE_ENV` or similar.\n- [ ] Did NOT hardcode credentials in any committed file.\n- [ ] Did NOT confabulate a `@prisma-next\u002Fpostgres\u002Fmiddleware` subpath, a `@prisma-next\u002Fpostgres-extension-audit` package, or a second type parameter on `postgres\u003C...>`.\n- [ ] Did NOT claim `db.transaction(...)` exists on the Mongo façade — only Postgres and SQLite expose it.\n- [ ] Did NOT confabulate read-replica \u002F multi-DB \u002F extra pool config — pointed at *What Prisma Next doesn't do yet* and routed to `prisma-next-feedback`.\n- [ ] For build-system \u002F dev-server prompts (Vite plugin, Next.js plugin, …) routed to `prisma-next-build`.\n",{"data":36,"body":37},{"name":4,"description":6},{"type":38,"children":39},"root",[40,58,72,91,98,185,191,297,303,624,635,654,673,1001,1060,1065,1151,1288,1294,1335,1359,1688,1721,2069,2087,2121,2412,2431,2767,2805,2813,3077,3129,3135,3140,3555,3589,3595,3630,3663,4415,4494,4500,4685,4690,4696,4775,5151,5169,5201,5207,5240,5632,5648,5654,5737,6009,6029,6035,6112,6117,6373,6378,6620,6702,6726,6732,6751,6818,6844,6850,7108,7113,7338,7344,7394,7400,7689],{"type":41,"tag":42,"props":43,"children":45},"element","h1",{"id":44},"prisma-next-runtime-dbts-wiring",[46,49,56],{"type":47,"value":48},"text","Prisma Next — Runtime (",{"type":41,"tag":50,"props":51,"children":53},"code",{"className":52},[],[54],{"type":47,"value":55},"db.ts",{"type":47,"value":57}," Wiring)",{"type":41,"tag":59,"props":60,"children":61},"blockquote",{},[62],{"type":41,"tag":63,"props":64,"children":65},"p",{},[66],{"type":41,"tag":67,"props":68,"children":69},"strong",{},[70],{"type":47,"value":71},"Edit your data contract. Prisma handles the rest.",{"type":41,"tag":63,"props":73,"children":74},{},[75,77,82,84,89],{"type":47,"value":76},"This skill covers the ",{"type":41,"tag":67,"props":78,"children":79},{},[80],{"type":47,"value":81},"runtime entry point",{"type":47,"value":83}," — ",{"type":41,"tag":50,"props":85,"children":87},{"className":86},[],[88],{"type":47,"value":55},{"type":47,"value":90}," — and how to compose the database client with extensions, middleware, and environment configuration.",{"type":41,"tag":92,"props":93,"children":95},"h2",{"id":94},"when-to-use",[96],{"type":47,"value":97},"When to Use",{"type":41,"tag":99,"props":100,"children":101},"ul",{},[102,115,120,125,130,143,172],{"type":41,"tag":103,"props":104,"children":105},"li",{},[106,108,113],{"type":47,"value":107},"User is wiring up ",{"type":41,"tag":50,"props":109,"children":111},{"className":110},[],[112],{"type":47,"value":55},{"type":47,"value":114}," for the first time (post-init).",{"type":41,"tag":103,"props":116,"children":117},{},[118],{"type":47,"value":119},"User wants to add middleware (telemetry, lints, budgets, custom).",{"type":41,"tag":103,"props":121,"children":122},{},[123],{"type":47,"value":124},"User wants per-environment config (dev vs prod, multi-region).",{"type":41,"tag":103,"props":126,"children":127},{},[128],{"type":47,"value":129},"User wants to switch between the Postgres, SQLite, and Mongo façades.",{"type":41,"tag":103,"props":131,"children":132},{},[133,135,141],{"type":47,"value":134},"User wants to wrap operations in ",{"type":41,"tag":50,"props":136,"children":138},{"className":137},[],[139],{"type":47,"value":140},"db.transaction(...)",{"type":47,"value":142}," (Postgres and SQLite).",{"type":41,"tag":103,"props":144,"children":145},{},[146,148,154,156,162,164,170],{"type":47,"value":147},"User is running a one-off script (",{"type":41,"tag":50,"props":149,"children":151},{"className":150},[],[152],{"type":47,"value":153},"tsx my-script.ts",{"type":47,"value":155},", Node CLI, CI task) and the process won't exit after queries finish, or they need script teardown (",{"type":41,"tag":50,"props":157,"children":159},{"className":158},[],[160],{"type":47,"value":161},"db.close()",{"type":47,"value":163},", ",{"type":41,"tag":50,"props":165,"children":167},{"className":166},[],[168],{"type":47,"value":169},"await using",{"type":47,"value":171},").",{"type":41,"tag":103,"props":173,"children":174},{},[175,177,183],{"type":47,"value":176},"User mentions: ",{"type":41,"tag":178,"props":179,"children":180},"em",{},[181],{"type":47,"value":182},"db.ts, postgres(), mongo(), middleware, telemetry, lints, budgets, DATABASE_URL, .env, connection pool, poolOptions, dev vs prod, transactions, read replicas, multi-database, script won't exit, hangs, db.close, db.end, close connection, pool.end, await using",{"type":47,"value":184},".",{"type":41,"tag":92,"props":186,"children":188},{"id":187},"when-not-to-use",[189],{"type":47,"value":190},"When Not to Use",{"type":41,"tag":99,"props":192,"children":193},{},[194,206,249,261,273,285],{"type":41,"tag":103,"props":195,"children":196},{},[197,199,205],{"type":47,"value":198},"User wants to write queries → ",{"type":41,"tag":50,"props":200,"children":202},{"className":201},[],[203],{"type":47,"value":204},"prisma-next-queries",{"type":47,"value":184},{"type":41,"tag":103,"props":207,"children":208},{},[209,211,217,219,225,227,233,234,240,242,248],{"type":47,"value":210},"User is on Supabase — the ",{"type":41,"tag":50,"props":212,"children":214},{"className":213},[],[215],{"type":47,"value":216},"supabase()",{"type":47,"value":218}," role-first factory, ",{"type":41,"tag":50,"props":220,"children":222},{"className":221},[],[223],{"type":47,"value":224},"asUser(jwt)",{"type":47,"value":226}," \u002F ",{"type":41,"tag":50,"props":228,"children":230},{"className":229},[],[231],{"type":47,"value":232},"asAnon()",{"type":47,"value":226},{"type":41,"tag":50,"props":235,"children":237},{"className":236},[],[238],{"type":47,"value":239},"asServiceRole()",{"type":47,"value":241},", JWT config, RLS → ",{"type":41,"tag":50,"props":243,"children":245},{"className":244},[],[246],{"type":47,"value":247},"prisma-next-supabase",{"type":47,"value":184},{"type":41,"tag":103,"props":250,"children":251},{},[252,254,260],{"type":47,"value":253},"User wants to edit the contract → ",{"type":41,"tag":50,"props":255,"children":257},{"className":256},[],[258],{"type":47,"value":259},"prisma-next-contract",{"type":47,"value":184},{"type":41,"tag":103,"props":262,"children":263},{},[264,266,272],{"type":47,"value":265},"User wants to wire Prisma Next into a build tool (Vite plugin, Next.js, …) → ",{"type":41,"tag":50,"props":267,"children":269},{"className":268},[],[270],{"type":47,"value":271},"prisma-next-build",{"type":47,"value":184},{"type":41,"tag":103,"props":274,"children":275},{},[276,278,284],{"type":47,"value":277},"User wants to debug a connection \u002F runtime error → ",{"type":41,"tag":50,"props":279,"children":281},{"className":280},[],[282],{"type":47,"value":283},"prisma-next-debug",{"type":47,"value":184},{"type":41,"tag":103,"props":286,"children":287},{},[288,290,296],{"type":47,"value":289},"User wants to file a bug or feature request → ",{"type":41,"tag":50,"props":291,"children":293},{"className":292},[],[294],{"type":47,"value":295},"prisma-next-feedback",{"type":47,"value":184},{"type":41,"tag":92,"props":298,"children":300},{"id":299},"key-concepts",[301],{"type":47,"value":302},"Key Concepts",{"type":41,"tag":99,"props":304,"children":305},{},[306,384,453,493,518,586],{"type":41,"tag":103,"props":307,"children":308},{},[309,319,321,327,329,335,336,342,344,350,352,358,360,366,368,374,376,382],{"type":41,"tag":67,"props":310,"children":311},{},[312,317],{"type":41,"tag":50,"props":313,"children":315},{"className":314},[],[316],{"type":47,"value":55},{"type":47,"value":318}," is the runtime entry point.",{"type":47,"value":320}," Imports the runtime factory from the ",{"type":41,"tag":50,"props":322,"children":324},{"className":323},[],[325],{"type":47,"value":326},"@prisma-next\u002F\u003Ctarget>",{"type":47,"value":328}," façade (",{"type":41,"tag":50,"props":330,"children":332},{"className":331},[],[333],{"type":47,"value":334},"@prisma-next\u002Fpostgres\u002Fruntime",{"type":47,"value":163},{"type":41,"tag":50,"props":337,"children":339},{"className":338},[],[340],{"type":47,"value":341},"@prisma-next\u002Fsqlite\u002Fruntime",{"type":47,"value":343},", or ",{"type":41,"tag":50,"props":345,"children":347},{"className":346},[],[348],{"type":47,"value":349},"@prisma-next\u002Fmongo\u002Fruntime",{"type":47,"value":351},"), the contract artefacts (",{"type":41,"tag":50,"props":353,"children":355},{"className":354},[],[356],{"type":47,"value":357},"contract.json",{"type":47,"value":359}," + the ",{"type":41,"tag":50,"props":361,"children":363},{"className":362},[],[364],{"type":47,"value":365},"Contract",{"type":47,"value":367}," type from ",{"type":41,"tag":50,"props":369,"children":371},{"className":370},[],[372],{"type":47,"value":373},"contract.d.ts",{"type":47,"value":375},"), and any middleware. Exports a ",{"type":41,"tag":50,"props":377,"children":379},{"className":378},[],[380],{"type":47,"value":381},"db",{"type":47,"value":383}," value the rest of your app imports.",{"type":41,"tag":103,"props":385,"children":386},{},[387,399,401,406,408,414,416,422,424,430,432,438,440,445,446,451],{"type":41,"tag":67,"props":388,"children":389},{},[390,392,397],{"type":47,"value":391},"The façade's runtime factory is the only surface user-authored ",{"type":41,"tag":50,"props":393,"children":395},{"className":394},[],[396],{"type":47,"value":55},{"type":47,"value":398}," imports from.",{"type":47,"value":400}," Each factory is a ",{"type":41,"tag":178,"props":402,"children":403},{},[404],{"type":47,"value":405},"default",{"type":47,"value":407}," export. For Postgres: ",{"type":41,"tag":50,"props":409,"children":411},{"className":410},[],[412],{"type":47,"value":413},"import postgres from '@prisma-next\u002Fpostgres\u002Fruntime'",{"type":47,"value":415},"; SQLite: ",{"type":41,"tag":50,"props":417,"children":419},{"className":418},[],[420],{"type":47,"value":421},"import sqlite from '@prisma-next\u002Fsqlite\u002Fruntime'",{"type":47,"value":423},"; Mongo: ",{"type":41,"tag":50,"props":425,"children":427},{"className":426},[],[428],{"type":47,"value":429},"import mongo from '@prisma-next\u002Fmongo\u002Fruntime'",{"type":47,"value":431},". The factory signature is ",{"type":41,"tag":50,"props":433,"children":435},{"className":434},[],[436],{"type":47,"value":437},"\u003CTarget>\u003CContract>(options)",{"type":47,"value":439}," — a single type parameter (the ",{"type":41,"tag":50,"props":441,"children":443},{"className":442},[],[444],{"type":47,"value":365},{"type":47,"value":367},{"type":41,"tag":50,"props":447,"children":449},{"className":448},[],[450],{"type":47,"value":373},{"type":47,"value":452},"), and one options object.",{"type":41,"tag":103,"props":454,"children":455},{},[456,461,463,469,470,476,478,484,486,491],{"type":41,"tag":67,"props":457,"children":458},{},[459],{"type":47,"value":460},"Lazy connect.",{"type":47,"value":462}," The factory does not connect to the database synchronously. Static query surfaces (",{"type":41,"tag":50,"props":464,"children":466},{"className":465},[],[467],{"type":47,"value":468},"db.sql",{"type":47,"value":163},{"type":41,"tag":50,"props":471,"children":473},{"className":472},[],[474],{"type":47,"value":475},"db.orm",{"type":47,"value":477},") are available immediately; the driver \u002F pool is instantiated on the first call that needs a runtime (or when you explicitly call ",{"type":41,"tag":50,"props":479,"children":481},{"className":480},[],[482],{"type":47,"value":483},"await db.connect({ url })",{"type":47,"value":485},"). This is why ",{"type":41,"tag":50,"props":487,"children":489},{"className":488},[],[490],{"type":47,"value":55},{"type":47,"value":492}," can be imported in modules that load before the env is ready.",{"type":41,"tag":103,"props":494,"children":495},{},[496,501,503,509,511,516],{"type":41,"tag":67,"props":497,"children":498},{},[499],{"type":47,"value":500},"Middleware composes in order.",{"type":47,"value":502}," The first middleware in the ",{"type":41,"tag":50,"props":504,"children":506},{"className":505},[],[507],{"type":47,"value":508},"middleware: [...]",{"type":47,"value":510}," array runs ",{"type":41,"tag":178,"props":512,"children":513},{},[514],{"type":47,"value":515},"outermost",{"type":47,"value":517}," — it sees the operation first on the way in and last on the way out. Telemetry first means budget \u002F lint failures show up inside telemetry spans.",{"type":41,"tag":103,"props":519,"children":520},{},[521,539,541,547,549,554,556,562,564,569,571,577,579,584],{"type":41,"tag":67,"props":522,"children":523},{},[524,530,532,538],{"type":41,"tag":50,"props":525,"children":527},{"className":526},[],[528],{"type":47,"value":529},"prisma-next.config.ts",{"type":47,"value":531}," vs ",{"type":41,"tag":50,"props":533,"children":535},{"className":534},[],[536],{"type":47,"value":537},".env",{"type":47,"value":184},{"type":47,"value":540}," The config (",{"type":41,"tag":50,"props":542,"children":544},{"className":543},[],[545],{"type":47,"value":546},"defineConfig({ contract, db, extensions, migrations })",{"type":47,"value":548},") is for static project shape: contract path, installed extensions, migrations directory, default connection string. ",{"type":41,"tag":50,"props":550,"children":552},{"className":551},[],[553],{"type":47,"value":537},{"type":47,"value":555}," is for per-environment values (",{"type":41,"tag":50,"props":557,"children":559},{"className":558},[],[560],{"type":47,"value":561},"DATABASE_URL",{"type":47,"value":563},", secrets). The config reads ",{"type":41,"tag":50,"props":565,"children":567},{"className":566},[],[568],{"type":47,"value":537},{"type":47,"value":570}," automatically via ",{"type":41,"tag":50,"props":572,"children":574},{"className":573},[],[575],{"type":47,"value":576},"dotenv\u002Fconfig",{"type":47,"value":578},". Hardcoding ",{"type":41,"tag":50,"props":580,"children":582},{"className":581},[],[583],{"type":47,"value":561},{"type":47,"value":585}," in the config file leaks credentials and bypasses per-env overrides.",{"type":41,"tag":103,"props":587,"children":588},{},[589,594,596,602,604,609,611,616,617,622],{"type":41,"tag":67,"props":590,"children":591},{},[592],{"type":47,"value":593},"Build-system \u002F dev-server integration is a separate skill.",{"type":47,"value":595}," ",{"type":41,"tag":50,"props":597,"children":599},{"className":598},[],[600],{"type":47,"value":601},"vite dev",{"type":47,"value":603}," auto-emit lives in ",{"type":41,"tag":50,"props":605,"children":607},{"className":606},[],[608],{"type":47,"value":271},{"type":47,"value":610},". The runtime side (this skill) reads ",{"type":41,"tag":50,"props":612,"children":614},{"className":613},[],[615],{"type":47,"value":357},{"type":47,"value":226},{"type":41,"tag":50,"props":618,"children":620},{"className":619},[],[621],{"type":47,"value":373},{"type":47,"value":623}," regardless of how they got onto disk, so the two skills compose cleanly.",{"type":41,"tag":92,"props":625,"children":627},{"id":626},"workflow-basic-dbts",[628,630],{"type":47,"value":629},"Workflow — Basic ",{"type":41,"tag":50,"props":631,"children":633},{"className":632},[],[634],{"type":47,"value":55},{"type":41,"tag":63,"props":636,"children":637},{},[638,640,645,647,652],{"type":47,"value":639},"The concept: ",{"type":41,"tag":50,"props":641,"children":643},{"className":642},[],[644],{"type":47,"value":55},{"type":47,"value":646}," is the seam between the emitted contract artefacts (target-shaped) and the runtime that executes queries against them. Three imports are load-bearing — the runtime factory, the ",{"type":41,"tag":50,"props":648,"children":650},{"className":649},[],[651],{"type":47,"value":365},{"type":47,"value":653}," type (so the static query surfaces are typed), and the JSON artefact (so the runtime validates the structure at construct time).",{"type":41,"tag":63,"props":655,"children":656},{},[657,663,665,671],{"type":41,"tag":50,"props":658,"children":660},{"className":659},[],[661],{"type":47,"value":662},"init",{"type":47,"value":664}," scaffolds something like this (for ",{"type":41,"tag":50,"props":666,"children":668},{"className":667},[],[669],{"type":47,"value":670},"--target postgres",{"type":47,"value":672},"):",{"type":41,"tag":674,"props":675,"children":680},"pre",{"className":676,"code":677,"language":678,"meta":679,"style":679},"language-typescript shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","\u002F\u002F src\u002Fprisma\u002Fdb.ts\nimport postgres from '@prisma-next\u002Fpostgres\u002Fruntime';\nimport type { Contract } from '.\u002Fcontract.d';\nimport contractJson from '.\u002Fcontract.json' with { type: 'json' };\n\nexport const db = postgres\u003CContract>({\n  contractJson,\n  url: process.env['DATABASE_URL'],\n});\n","typescript","",[681],{"type":41,"tag":50,"props":682,"children":683},{"__ignoreMap":679},[684,696,738,788,855,865,921,935,983],{"type":41,"tag":685,"props":686,"children":689},"span",{"class":687,"line":688},"line",1,[690],{"type":41,"tag":685,"props":691,"children":693},{"style":692},"--shiki-light:#90A4AE;--shiki-light-font-style:italic;--shiki-default:#546E7A;--shiki-default-font-style:italic;--shiki-dark:#676E95;--shiki-dark-font-style:italic",[694],{"type":47,"value":695},"\u002F\u002F src\u002Fprisma\u002Fdb.ts\n",{"type":41,"tag":685,"props":697,"children":699},{"class":687,"line":698},2,[700,706,712,717,723,728,733],{"type":41,"tag":685,"props":701,"children":703},{"style":702},"--shiki-light:#39ADB5;--shiki-light-font-style:italic;--shiki-default:#89DDFF;--shiki-default-font-style:italic;--shiki-dark:#89DDFF;--shiki-dark-font-style:italic",[704],{"type":47,"value":705},"import",{"type":41,"tag":685,"props":707,"children":709},{"style":708},"--shiki-light:#90A4AE;--shiki-default:#EEFFFF;--shiki-dark:#BABED8",[710],{"type":47,"value":711}," postgres ",{"type":41,"tag":685,"props":713,"children":714},{"style":702},[715],{"type":47,"value":716},"from",{"type":41,"tag":685,"props":718,"children":720},{"style":719},"--shiki-light:#39ADB5;--shiki-default:#89DDFF;--shiki-dark:#89DDFF",[721],{"type":47,"value":722}," '",{"type":41,"tag":685,"props":724,"children":726},{"style":725},"--shiki-light:#91B859;--shiki-default:#C3E88D;--shiki-dark:#C3E88D",[727],{"type":47,"value":334},{"type":41,"tag":685,"props":729,"children":730},{"style":719},[731],{"type":47,"value":732},"'",{"type":41,"tag":685,"props":734,"children":735},{"style":719},[736],{"type":47,"value":737},";\n",{"type":41,"tag":685,"props":739,"children":741},{"class":687,"line":740},3,[742,746,751,756,761,766,771,775,780,784],{"type":41,"tag":685,"props":743,"children":744},{"style":702},[745],{"type":47,"value":705},{"type":41,"tag":685,"props":747,"children":748},{"style":702},[749],{"type":47,"value":750}," type",{"type":41,"tag":685,"props":752,"children":753},{"style":719},[754],{"type":47,"value":755}," {",{"type":41,"tag":685,"props":757,"children":758},{"style":708},[759],{"type":47,"value":760}," Contract",{"type":41,"tag":685,"props":762,"children":763},{"style":719},[764],{"type":47,"value":765}," }",{"type":41,"tag":685,"props":767,"children":768},{"style":702},[769],{"type":47,"value":770}," from",{"type":41,"tag":685,"props":772,"children":773},{"style":719},[774],{"type":47,"value":722},{"type":41,"tag":685,"props":776,"children":777},{"style":725},[778],{"type":47,"value":779},".\u002Fcontract.d",{"type":41,"tag":685,"props":781,"children":782},{"style":719},[783],{"type":47,"value":732},{"type":41,"tag":685,"props":785,"children":786},{"style":719},[787],{"type":47,"value":737},{"type":41,"tag":685,"props":789,"children":791},{"class":687,"line":790},4,[792,796,801,805,809,814,818,823,827,832,837,841,846,850],{"type":41,"tag":685,"props":793,"children":794},{"style":702},[795],{"type":47,"value":705},{"type":41,"tag":685,"props":797,"children":798},{"style":708},[799],{"type":47,"value":800}," contractJson ",{"type":41,"tag":685,"props":802,"children":803},{"style":702},[804],{"type":47,"value":716},{"type":41,"tag":685,"props":806,"children":807},{"style":719},[808],{"type":47,"value":722},{"type":41,"tag":685,"props":810,"children":811},{"style":725},[812],{"type":47,"value":813},".\u002Fcontract.json",{"type":41,"tag":685,"props":815,"children":816},{"style":719},[817],{"type":47,"value":732},{"type":41,"tag":685,"props":819,"children":820},{"style":702},[821],{"type":47,"value":822}," with",{"type":41,"tag":685,"props":824,"children":825},{"style":719},[826],{"type":47,"value":755},{"type":41,"tag":685,"props":828,"children":830},{"style":829},"--shiki-light:#E53935;--shiki-default:#F07178;--shiki-dark:#F07178",[831],{"type":47,"value":750},{"type":41,"tag":685,"props":833,"children":834},{"style":719},[835],{"type":47,"value":836},":",{"type":41,"tag":685,"props":838,"children":839},{"style":719},[840],{"type":47,"value":722},{"type":41,"tag":685,"props":842,"children":843},{"style":725},[844],{"type":47,"value":845},"json",{"type":41,"tag":685,"props":847,"children":848},{"style":719},[849],{"type":47,"value":732},{"type":41,"tag":685,"props":851,"children":852},{"style":719},[853],{"type":47,"value":854}," };\n",{"type":41,"tag":685,"props":856,"children":858},{"class":687,"line":857},5,[859],{"type":41,"tag":685,"props":860,"children":862},{"emptyLinePlaceholder":861},true,[863],{"type":47,"value":864},"\n",{"type":41,"tag":685,"props":866,"children":868},{"class":687,"line":867},6,[869,874,880,885,890,896,901,906,911,916],{"type":41,"tag":685,"props":870,"children":871},{"style":702},[872],{"type":47,"value":873},"export",{"type":41,"tag":685,"props":875,"children":877},{"style":876},"--shiki-light:#9C3EDA;--shiki-default:#C792EA;--shiki-dark:#C792EA",[878],{"type":47,"value":879}," const",{"type":41,"tag":685,"props":881,"children":882},{"style":708},[883],{"type":47,"value":884}," db ",{"type":41,"tag":685,"props":886,"children":887},{"style":719},[888],{"type":47,"value":889},"=",{"type":41,"tag":685,"props":891,"children":893},{"style":892},"--shiki-light:#6182B8;--shiki-default:#82AAFF;--shiki-dark:#82AAFF",[894],{"type":47,"value":895}," postgres",{"type":41,"tag":685,"props":897,"children":898},{"style":719},[899],{"type":47,"value":900},"\u003C",{"type":41,"tag":685,"props":902,"children":904},{"style":903},"--shiki-light:#E2931D;--shiki-default:#FFCB6B;--shiki-dark:#FFCB6B",[905],{"type":47,"value":365},{"type":41,"tag":685,"props":907,"children":908},{"style":719},[909],{"type":47,"value":910},">",{"type":41,"tag":685,"props":912,"children":913},{"style":708},[914],{"type":47,"value":915},"(",{"type":41,"tag":685,"props":917,"children":918},{"style":719},[919],{"type":47,"value":920},"{\n",{"type":41,"tag":685,"props":922,"children":924},{"class":687,"line":923},7,[925,930],{"type":41,"tag":685,"props":926,"children":927},{"style":708},[928],{"type":47,"value":929},"  contractJson",{"type":41,"tag":685,"props":931,"children":932},{"style":719},[933],{"type":47,"value":934},",\n",{"type":41,"tag":685,"props":936,"children":938},{"class":687,"line":937},8,[939,944,948,953,957,962,966,970,974,979],{"type":41,"tag":685,"props":940,"children":941},{"style":829},[942],{"type":47,"value":943},"  url",{"type":41,"tag":685,"props":945,"children":946},{"style":719},[947],{"type":47,"value":836},{"type":41,"tag":685,"props":949,"children":950},{"style":708},[951],{"type":47,"value":952}," process",{"type":41,"tag":685,"props":954,"children":955},{"style":719},[956],{"type":47,"value":184},{"type":41,"tag":685,"props":958,"children":959},{"style":708},[960],{"type":47,"value":961},"env[",{"type":41,"tag":685,"props":963,"children":964},{"style":719},[965],{"type":47,"value":732},{"type":41,"tag":685,"props":967,"children":968},{"style":725},[969],{"type":47,"value":561},{"type":41,"tag":685,"props":971,"children":972},{"style":719},[973],{"type":47,"value":732},{"type":41,"tag":685,"props":975,"children":976},{"style":708},[977],{"type":47,"value":978},"]",{"type":41,"tag":685,"props":980,"children":981},{"style":719},[982],{"type":47,"value":934},{"type":41,"tag":685,"props":984,"children":986},{"class":687,"line":985},9,[987,992,997],{"type":41,"tag":685,"props":988,"children":989},{"style":719},[990],{"type":47,"value":991},"}",{"type":41,"tag":685,"props":993,"children":994},{"style":708},[995],{"type":47,"value":996},")",{"type":41,"tag":685,"props":998,"children":999},{"style":719},[1000],{"type":47,"value":737},{"type":41,"tag":63,"props":1002,"children":1003},{},[1004,1005,1010,1012,1018,1020,1026,1028,1034,1036,1042,1044,1050,1052,1058],{"type":47,"value":915},{"type":41,"tag":50,"props":1006,"children":1008},{"className":1007},[],[1009],{"type":47,"value":662},{"type":47,"value":1011}," currently scaffolds at ",{"type":41,"tag":50,"props":1013,"children":1015},{"className":1014},[],[1016],{"type":47,"value":1017},"prisma\u002Fdb.ts",{"type":47,"value":1019}," instead — see TML-2532 in ",{"type":41,"tag":50,"props":1021,"children":1023},{"className":1022},[],[1024],{"type":47,"value":1025},"prisma-next-quickstart",{"type":47,"value":1027},". The canonical path is ",{"type":41,"tag":50,"props":1029,"children":1031},{"className":1030},[],[1032],{"type":47,"value":1033},"src\u002Fprisma\u002Fdb.ts",{"type":47,"value":1035},"; the rest of ",{"type":41,"tag":50,"props":1037,"children":1039},{"className":1038},[],[1040],{"type":47,"value":1041},"src\u002F",{"type":47,"value":1043}," imports from ",{"type":41,"tag":50,"props":1045,"children":1047},{"className":1046},[],[1048],{"type":47,"value":1049},".\u002Fprisma\u002Fdb",{"type":47,"value":1051}," or ",{"type":41,"tag":50,"props":1053,"children":1055},{"className":1054},[],[1056],{"type":47,"value":1057},"..\u002Fprisma\u002Fdb",{"type":47,"value":1059}," depending on depth.)",{"type":41,"tag":63,"props":1061,"children":1062},{},[1063],{"type":47,"value":1064},"Three things to know:",{"type":41,"tag":99,"props":1066,"children":1067},{},[1068,1098,1114],{"type":41,"tag":103,"props":1069,"children":1070},{},[1071,1082,1084,1089,1091,1097],{"type":41,"tag":67,"props":1072,"children":1073},{},[1074,1080],{"type":41,"tag":50,"props":1075,"children":1077},{"className":1076},[],[1078],{"type":47,"value":1079},"\u003CContract>",{"type":47,"value":1081}," type parameter is load-bearing.",{"type":47,"value":1083}," Without it, the static surfaces collapse to a generic shape and you lose autocomplete on model names. Always import ",{"type":41,"tag":50,"props":1085,"children":1087},{"className":1086},[],[1088],{"type":47,"value":365},{"type":47,"value":1090}," from the emitted ",{"type":41,"tag":50,"props":1092,"children":1094},{"className":1093},[],[1095],{"type":47,"value":1096},".\u002Fcontract.d.ts",{"type":47,"value":184},{"type":41,"tag":103,"props":1099,"children":1100},{},[1101,1112],{"type":41,"tag":67,"props":1102,"children":1103},{},[1104,1110],{"type":41,"tag":50,"props":1105,"children":1107},{"className":1106},[],[1108],{"type":47,"value":1109},"with { type: 'json' }",{"type":47,"value":1111}," is required.",{"type":47,"value":1113}," Node's ESM JSON-import-attribute spec. Without it, the import errors.",{"type":41,"tag":103,"props":1115,"children":1116},{},[1117,1128,1130,1135,1137,1142,1144,1149],{"type":41,"tag":67,"props":1118,"children":1119},{},[1120,1126],{"type":41,"tag":50,"props":1121,"children":1123},{"className":1122},[],[1124],{"type":47,"value":1125},"url",{"type":47,"value":1127}," is optional at construct time.",{"type":47,"value":1129}," If ",{"type":41,"tag":50,"props":1131,"children":1133},{"className":1132},[],[1134],{"type":47,"value":561},{"type":47,"value":1136}," is not set when ",{"type":41,"tag":50,"props":1138,"children":1140},{"className":1139},[],[1141],{"type":47,"value":55},{"type":47,"value":1143}," loads, the factory still returns a client; you can call ",{"type":41,"tag":50,"props":1145,"children":1147},{"className":1146},[],[1148],{"type":47,"value":483},{"type":47,"value":1150}," later. The factory throws lazily — only when a runtime is actually needed.",{"type":41,"tag":63,"props":1152,"children":1153},{},[1154,1156,1161,1163,1169,1170,1175,1177,1188,1190,1195,1197,1202,1204,1209,1211,1217,1219,1225,1227,1233,1235,1241,1243,1249,1251,1257,1259,1264,1266,1272,1274,1279,1281,1286],{"type":47,"value":1155},"The Mongo façade has the same construction shape — ",{"type":41,"tag":50,"props":1157,"children":1159},{"className":1158},[],[1160],{"type":47,"value":429},{"type":47,"value":1162}," — and the same ",{"type":41,"tag":50,"props":1164,"children":1166},{"className":1165},[],[1167],{"type":47,"value":1168},"db.connect(...)",{"type":47,"value":226},{"type":41,"tag":50,"props":1171,"children":1173},{"className":1172},[],[1174],{"type":47,"value":161},{"type":47,"value":1176}," lifecycle methods. ",{"type":41,"tag":67,"props":1178,"children":1179},{},[1180,1182,1187],{"type":47,"value":1181},"The Mongo façade does not expose ",{"type":41,"tag":50,"props":1183,"children":1185},{"className":1184},[],[1186],{"type":47,"value":140},{"type":47,"value":184},{"type":47,"value":1189}," See ",{"type":41,"tag":178,"props":1191,"children":1192},{},[1193],{"type":47,"value":1194},"What Prisma Next doesn't do yet",{"type":47,"value":1196}," for the workaround. ",{"type":41,"tag":67,"props":1198,"children":1199},{},[1200],{"type":47,"value":1201},"The ORM surface differs in one place: keys.",{"type":47,"value":1203}," On Mongo, ",{"type":41,"tag":50,"props":1205,"children":1207},{"className":1206},[],[1208],{"type":47,"value":475},{"type":47,"value":1210}," is keyed by the collection's storage name (from ",{"type":41,"tag":50,"props":1212,"children":1214},{"className":1213},[],[1215],{"type":47,"value":1216},"@@map(...)",{"type":47,"value":1218},", or the lowercased model name if no ",{"type":41,"tag":50,"props":1220,"children":1222},{"className":1221},[],[1223],{"type":47,"value":1224},"@@map",{"type":47,"value":1226}," is set), not by the PSL model name — so ",{"type":41,"tag":50,"props":1228,"children":1230},{"className":1229},[],[1231],{"type":47,"value":1232},"model User { … @@map(\"users\") }",{"type":47,"value":1234}," is reached at ",{"type":41,"tag":50,"props":1236,"children":1238},{"className":1237},[],[1239],{"type":47,"value":1240},"db.orm.users",{"type":47,"value":1242},", not ",{"type":41,"tag":50,"props":1244,"children":1246},{"className":1245},[],[1247],{"type":47,"value":1248},"db.orm.User",{"type":47,"value":1250},". The SQL builder lane (",{"type":41,"tag":50,"props":1252,"children":1254},{"className":1253},[],[1255],{"type":47,"value":1256},"db.sql.\u003Ctable>",{"type":47,"value":1258},") doesn't exist on Mongo at all (",{"type":41,"tag":50,"props":1260,"children":1262},{"className":1261},[],[1263],{"type":47,"value":468},{"type":47,"value":1265}," is ",{"type":41,"tag":50,"props":1267,"children":1269},{"className":1268},[],[1270],{"type":47,"value":1271},"undefined",{"type":47,"value":1273},"). See ",{"type":41,"tag":50,"props":1275,"children":1277},{"className":1276},[],[1278],{"type":47,"value":204},{"type":47,"value":1280}," § ",{"type":41,"tag":178,"props":1282,"children":1283},{},[1284],{"type":47,"value":1285},"MongoDB ORM addressing",{"type":47,"value":1287}," for the full rule and a rewrite recipe for SQL-target examples.",{"type":41,"tag":92,"props":1289,"children":1291},{"id":1290},"workflow-running-as-a-script-teardown",[1292],{"type":47,"value":1293},"Workflow — Running as a script (teardown)",{"type":41,"tag":63,"props":1295,"children":1296},{},[1297,1299,1304,1306,1312,1314,1320,1322,1327,1328,1333],{"type":47,"value":1298},"The concept: short scripts that connect, query, then expect the process to exit will ",{"type":41,"tag":67,"props":1300,"children":1301},{},[1302],{"type":47,"value":1303},"hang on Postgres",{"type":47,"value":1305}," because the façade-owned ",{"type":41,"tag":50,"props":1307,"children":1309},{"className":1308},[],[1310],{"type":47,"value":1311},"pg.Pool",{"type":47,"value":1313}," keeps Node's event loop alive. The data round-trip succeeds; the script never exits. Call ",{"type":41,"tag":50,"props":1315,"children":1317},{"className":1316},[],[1318],{"type":47,"value":1319},"await db.close()",{"type":47,"value":1321}," before the script returns (or use ",{"type":41,"tag":50,"props":1323,"children":1325},{"className":1324},[],[1326],{"type":47,"value":169},{"type":47,"value":595},{"type":41,"tag":67,"props":1329,"children":1330},{},[1331],{"type":47,"value":1332},"at the top of a script module",{"type":47,"value":1334}," so teardown runs when the module exits — see the block-scope warning below for why this matters).",{"type":41,"tag":63,"props":1336,"children":1337},{},[1338,1343,1345,1350,1352,1357],{"type":41,"tag":67,"props":1339,"children":1340},{},[1341],{"type":47,"value":1342},"Plain shape",{"type":47,"value":1344}," — export ",{"type":41,"tag":50,"props":1346,"children":1348},{"className":1347},[],[1349],{"type":47,"value":381},{"type":47,"value":1351}," from ",{"type":41,"tag":50,"props":1353,"children":1355},{"className":1354},[],[1356],{"type":47,"value":55},{"type":47,"value":1358},", import it in the script, close at the end:",{"type":41,"tag":674,"props":1360,"children":1362},{"className":676,"code":1361,"language":678,"meta":679,"style":679},"\u002F\u002F src\u002Fscripts\u002Fhello.ts\nimport { db } from '..\u002Fprisma\u002Fdb';\n\nconst created = await db.orm.User.create({ email: 'alice@example.com', name: 'Alice' });\nconst read = await db.orm.User.first();\nconsole.log({ created, read });\n\nawait db.close();\n",[1363],{"type":41,"tag":50,"props":1364,"children":1365},{"__ignoreMap":679},[1366,1374,1414,1421,1544,1602,1652,1659],{"type":41,"tag":685,"props":1367,"children":1368},{"class":687,"line":688},[1369],{"type":41,"tag":685,"props":1370,"children":1371},{"style":692},[1372],{"type":47,"value":1373},"\u002F\u002F src\u002Fscripts\u002Fhello.ts\n",{"type":41,"tag":685,"props":1375,"children":1376},{"class":687,"line":698},[1377,1381,1385,1390,1394,1398,1402,1406,1410],{"type":41,"tag":685,"props":1378,"children":1379},{"style":702},[1380],{"type":47,"value":705},{"type":41,"tag":685,"props":1382,"children":1383},{"style":719},[1384],{"type":47,"value":755},{"type":41,"tag":685,"props":1386,"children":1387},{"style":708},[1388],{"type":47,"value":1389}," db",{"type":41,"tag":685,"props":1391,"children":1392},{"style":719},[1393],{"type":47,"value":765},{"type":41,"tag":685,"props":1395,"children":1396},{"style":702},[1397],{"type":47,"value":770},{"type":41,"tag":685,"props":1399,"children":1400},{"style":719},[1401],{"type":47,"value":722},{"type":41,"tag":685,"props":1403,"children":1404},{"style":725},[1405],{"type":47,"value":1057},{"type":41,"tag":685,"props":1407,"children":1408},{"style":719},[1409],{"type":47,"value":732},{"type":41,"tag":685,"props":1411,"children":1412},{"style":719},[1413],{"type":47,"value":737},{"type":41,"tag":685,"props":1415,"children":1416},{"class":687,"line":740},[1417],{"type":41,"tag":685,"props":1418,"children":1419},{"emptyLinePlaceholder":861},[1420],{"type":47,"value":864},{"type":41,"tag":685,"props":1422,"children":1423},{"class":687,"line":790},[1424,1429,1434,1438,1443,1447,1451,1456,1460,1465,1469,1474,1478,1483,1488,1492,1496,1501,1505,1510,1515,1519,1523,1528,1532,1536,1540],{"type":41,"tag":685,"props":1425,"children":1426},{"style":876},[1427],{"type":47,"value":1428},"const",{"type":41,"tag":685,"props":1430,"children":1431},{"style":708},[1432],{"type":47,"value":1433}," created ",{"type":41,"tag":685,"props":1435,"children":1436},{"style":719},[1437],{"type":47,"value":889},{"type":41,"tag":685,"props":1439,"children":1440},{"style":702},[1441],{"type":47,"value":1442}," await",{"type":41,"tag":685,"props":1444,"children":1445},{"style":708},[1446],{"type":47,"value":1389},{"type":41,"tag":685,"props":1448,"children":1449},{"style":719},[1450],{"type":47,"value":184},{"type":41,"tag":685,"props":1452,"children":1453},{"style":708},[1454],{"type":47,"value":1455},"orm",{"type":41,"tag":685,"props":1457,"children":1458},{"style":719},[1459],{"type":47,"value":184},{"type":41,"tag":685,"props":1461,"children":1462},{"style":708},[1463],{"type":47,"value":1464},"User",{"type":41,"tag":685,"props":1466,"children":1467},{"style":719},[1468],{"type":47,"value":184},{"type":41,"tag":685,"props":1470,"children":1471},{"style":892},[1472],{"type":47,"value":1473},"create",{"type":41,"tag":685,"props":1475,"children":1476},{"style":708},[1477],{"type":47,"value":915},{"type":41,"tag":685,"props":1479,"children":1480},{"style":719},[1481],{"type":47,"value":1482},"{",{"type":41,"tag":685,"props":1484,"children":1485},{"style":829},[1486],{"type":47,"value":1487}," email",{"type":41,"tag":685,"props":1489,"children":1490},{"style":719},[1491],{"type":47,"value":836},{"type":41,"tag":685,"props":1493,"children":1494},{"style":719},[1495],{"type":47,"value":722},{"type":41,"tag":685,"props":1497,"children":1498},{"style":725},[1499],{"type":47,"value":1500},"alice@example.com",{"type":41,"tag":685,"props":1502,"children":1503},{"style":719},[1504],{"type":47,"value":732},{"type":41,"tag":685,"props":1506,"children":1507},{"style":719},[1508],{"type":47,"value":1509},",",{"type":41,"tag":685,"props":1511,"children":1512},{"style":829},[1513],{"type":47,"value":1514}," name",{"type":41,"tag":685,"props":1516,"children":1517},{"style":719},[1518],{"type":47,"value":836},{"type":41,"tag":685,"props":1520,"children":1521},{"style":719},[1522],{"type":47,"value":722},{"type":41,"tag":685,"props":1524,"children":1525},{"style":725},[1526],{"type":47,"value":1527},"Alice",{"type":41,"tag":685,"props":1529,"children":1530},{"style":719},[1531],{"type":47,"value":732},{"type":41,"tag":685,"props":1533,"children":1534},{"style":719},[1535],{"type":47,"value":765},{"type":41,"tag":685,"props":1537,"children":1538},{"style":708},[1539],{"type":47,"value":996},{"type":41,"tag":685,"props":1541,"children":1542},{"style":719},[1543],{"type":47,"value":737},{"type":41,"tag":685,"props":1545,"children":1546},{"class":687,"line":857},[1547,1551,1556,1560,1564,1568,1572,1576,1580,1584,1588,1593,1598],{"type":41,"tag":685,"props":1548,"children":1549},{"style":876},[1550],{"type":47,"value":1428},{"type":41,"tag":685,"props":1552,"children":1553},{"style":708},[1554],{"type":47,"value":1555}," read ",{"type":41,"tag":685,"props":1557,"children":1558},{"style":719},[1559],{"type":47,"value":889},{"type":41,"tag":685,"props":1561,"children":1562},{"style":702},[1563],{"type":47,"value":1442},{"type":41,"tag":685,"props":1565,"children":1566},{"style":708},[1567],{"type":47,"value":1389},{"type":41,"tag":685,"props":1569,"children":1570},{"style":719},[1571],{"type":47,"value":184},{"type":41,"tag":685,"props":1573,"children":1574},{"style":708},[1575],{"type":47,"value":1455},{"type":41,"tag":685,"props":1577,"children":1578},{"style":719},[1579],{"type":47,"value":184},{"type":41,"tag":685,"props":1581,"children":1582},{"style":708},[1583],{"type":47,"value":1464},{"type":41,"tag":685,"props":1585,"children":1586},{"style":719},[1587],{"type":47,"value":184},{"type":41,"tag":685,"props":1589,"children":1590},{"style":892},[1591],{"type":47,"value":1592},"first",{"type":41,"tag":685,"props":1594,"children":1595},{"style":708},[1596],{"type":47,"value":1597},"()",{"type":41,"tag":685,"props":1599,"children":1600},{"style":719},[1601],{"type":47,"value":737},{"type":41,"tag":685,"props":1603,"children":1604},{"class":687,"line":867},[1605,1610,1614,1619,1623,1627,1632,1636,1640,1644,1648],{"type":41,"tag":685,"props":1606,"children":1607},{"style":708},[1608],{"type":47,"value":1609},"console",{"type":41,"tag":685,"props":1611,"children":1612},{"style":719},[1613],{"type":47,"value":184},{"type":41,"tag":685,"props":1615,"children":1616},{"style":892},[1617],{"type":47,"value":1618},"log",{"type":41,"tag":685,"props":1620,"children":1621},{"style":708},[1622],{"type":47,"value":915},{"type":41,"tag":685,"props":1624,"children":1625},{"style":719},[1626],{"type":47,"value":1482},{"type":41,"tag":685,"props":1628,"children":1629},{"style":708},[1630],{"type":47,"value":1631}," created",{"type":41,"tag":685,"props":1633,"children":1634},{"style":719},[1635],{"type":47,"value":1509},{"type":41,"tag":685,"props":1637,"children":1638},{"style":708},[1639],{"type":47,"value":1555},{"type":41,"tag":685,"props":1641,"children":1642},{"style":719},[1643],{"type":47,"value":991},{"type":41,"tag":685,"props":1645,"children":1646},{"style":708},[1647],{"type":47,"value":996},{"type":41,"tag":685,"props":1649,"children":1650},{"style":719},[1651],{"type":47,"value":737},{"type":41,"tag":685,"props":1653,"children":1654},{"class":687,"line":923},[1655],{"type":41,"tag":685,"props":1656,"children":1657},{"emptyLinePlaceholder":861},[1658],{"type":47,"value":864},{"type":41,"tag":685,"props":1660,"children":1661},{"class":687,"line":937},[1662,1667,1671,1675,1680,1684],{"type":41,"tag":685,"props":1663,"children":1664},{"style":702},[1665],{"type":47,"value":1666},"await",{"type":41,"tag":685,"props":1668,"children":1669},{"style":708},[1670],{"type":47,"value":1389},{"type":41,"tag":685,"props":1672,"children":1673},{"style":719},[1674],{"type":47,"value":184},{"type":41,"tag":685,"props":1676,"children":1677},{"style":892},[1678],{"type":47,"value":1679},"close",{"type":41,"tag":685,"props":1681,"children":1682},{"style":708},[1683],{"type":47,"value":1597},{"type":41,"tag":685,"props":1685,"children":1686},{"style":719},[1687],{"type":47,"value":737},{"type":41,"tag":63,"props":1689,"children":1690},{},[1691,1696,1698,1703,1705,1711,1713,1719],{"type":41,"tag":67,"props":1692,"children":1693},{},[1694],{"type":47,"value":1695},"TS 5.2+ idiomatic shape",{"type":47,"value":1697}," — construct the client at the ",{"type":41,"tag":67,"props":1699,"children":1700},{},[1701],{"type":47,"value":1702},"top of a script module",{"type":47,"value":1704}," and let ",{"type":41,"tag":50,"props":1706,"children":1708},{"className":1707},[],[1709],{"type":47,"value":1710},"[Symbol.asyncDispose]",{"type":47,"value":1712}," call ",{"type":41,"tag":50,"props":1714,"children":1716},{"className":1715},[],[1717],{"type":47,"value":1718},"close()",{"type":47,"value":1720}," when the module exits:",{"type":41,"tag":674,"props":1722,"children":1724},{"className":676,"code":1723,"language":678,"meta":679,"style":679},"\u002F\u002F src\u002Fscripts\u002Fhello.ts — top-level await in a script module\nimport postgres from '@prisma-next\u002Fpostgres\u002Fruntime';\nimport type { Contract } from '..\u002Fprisma\u002Fcontract.d';\nimport contractJson from '..\u002Fprisma\u002Fcontract.json' with { type: 'json' };\n\nawait using db = postgres\u003CContract>({ contractJson, url: process.env.DATABASE_URL! });\n\nconst user = await db.orm.User.first();\nconsole.log(user);\n\u002F\u002F db.close() runs automatically when the script module exits.\n",[1725],{"type":41,"tag":50,"props":1726,"children":1727},{"__ignoreMap":679},[1728,1736,1767,1811,1871,1878,1973,1980,2036,2060],{"type":41,"tag":685,"props":1729,"children":1730},{"class":687,"line":688},[1731],{"type":41,"tag":685,"props":1732,"children":1733},{"style":692},[1734],{"type":47,"value":1735},"\u002F\u002F src\u002Fscripts\u002Fhello.ts — top-level await in a script module\n",{"type":41,"tag":685,"props":1737,"children":1738},{"class":687,"line":698},[1739,1743,1747,1751,1755,1759,1763],{"type":41,"tag":685,"props":1740,"children":1741},{"style":702},[1742],{"type":47,"value":705},{"type":41,"tag":685,"props":1744,"children":1745},{"style":708},[1746],{"type":47,"value":711},{"type":41,"tag":685,"props":1748,"children":1749},{"style":702},[1750],{"type":47,"value":716},{"type":41,"tag":685,"props":1752,"children":1753},{"style":719},[1754],{"type":47,"value":722},{"type":41,"tag":685,"props":1756,"children":1757},{"style":725},[1758],{"type":47,"value":334},{"type":41,"tag":685,"props":1760,"children":1761},{"style":719},[1762],{"type":47,"value":732},{"type":41,"tag":685,"props":1764,"children":1765},{"style":719},[1766],{"type":47,"value":737},{"type":41,"tag":685,"props":1768,"children":1769},{"class":687,"line":740},[1770,1774,1778,1782,1786,1790,1794,1798,1803,1807],{"type":41,"tag":685,"props":1771,"children":1772},{"style":702},[1773],{"type":47,"value":705},{"type":41,"tag":685,"props":1775,"children":1776},{"style":702},[1777],{"type":47,"value":750},{"type":41,"tag":685,"props":1779,"children":1780},{"style":719},[1781],{"type":47,"value":755},{"type":41,"tag":685,"props":1783,"children":1784},{"style":708},[1785],{"type":47,"value":760},{"type":41,"tag":685,"props":1787,"children":1788},{"style":719},[1789],{"type":47,"value":765},{"type":41,"tag":685,"props":1791,"children":1792},{"style":702},[1793],{"type":47,"value":770},{"type":41,"tag":685,"props":1795,"children":1796},{"style":719},[1797],{"type":47,"value":722},{"type":41,"tag":685,"props":1799,"children":1800},{"style":725},[1801],{"type":47,"value":1802},"..\u002Fprisma\u002Fcontract.d",{"type":41,"tag":685,"props":1804,"children":1805},{"style":719},[1806],{"type":47,"value":732},{"type":41,"tag":685,"props":1808,"children":1809},{"style":719},[1810],{"type":47,"value":737},{"type":41,"tag":685,"props":1812,"children":1813},{"class":687,"line":790},[1814,1818,1822,1826,1830,1835,1839,1843,1847,1851,1855,1859,1863,1867],{"type":41,"tag":685,"props":1815,"children":1816},{"style":702},[1817],{"type":47,"value":705},{"type":41,"tag":685,"props":1819,"children":1820},{"style":708},[1821],{"type":47,"value":800},{"type":41,"tag":685,"props":1823,"children":1824},{"style":702},[1825],{"type":47,"value":716},{"type":41,"tag":685,"props":1827,"children":1828},{"style":719},[1829],{"type":47,"value":722},{"type":41,"tag":685,"props":1831,"children":1832},{"style":725},[1833],{"type":47,"value":1834},"..\u002Fprisma\u002Fcontract.json",{"type":41,"tag":685,"props":1836,"children":1837},{"style":719},[1838],{"type":47,"value":732},{"type":41,"tag":685,"props":1840,"children":1841},{"style":702},[1842],{"type":47,"value":822},{"type":41,"tag":685,"props":1844,"children":1845},{"style":719},[1846],{"type":47,"value":755},{"type":41,"tag":685,"props":1848,"children":1849},{"style":829},[1850],{"type":47,"value":750},{"type":41,"tag":685,"props":1852,"children":1853},{"style":719},[1854],{"type":47,"value":836},{"type":41,"tag":685,"props":1856,"children":1857},{"style":719},[1858],{"type":47,"value":722},{"type":41,"tag":685,"props":1860,"children":1861},{"style":725},[1862],{"type":47,"value":845},{"type":41,"tag":685,"props":1864,"children":1865},{"style":719},[1866],{"type":47,"value":732},{"type":41,"tag":685,"props":1868,"children":1869},{"style":719},[1870],{"type":47,"value":854},{"type":41,"tag":685,"props":1872,"children":1873},{"class":687,"line":857},[1874],{"type":41,"tag":685,"props":1875,"children":1876},{"emptyLinePlaceholder":861},[1877],{"type":47,"value":864},{"type":41,"tag":685,"props":1879,"children":1880},{"class":687,"line":867},[1881,1885,1889,1893,1897,1901,1905,1909,1913,1917,1922,1926,1931,1935,1939,1943,1948,1952,1956,1961,1965,1969],{"type":41,"tag":685,"props":1882,"children":1883},{"style":876},[1884],{"type":47,"value":169},{"type":41,"tag":685,"props":1886,"children":1887},{"style":708},[1888],{"type":47,"value":884},{"type":41,"tag":685,"props":1890,"children":1891},{"style":719},[1892],{"type":47,"value":889},{"type":41,"tag":685,"props":1894,"children":1895},{"style":892},[1896],{"type":47,"value":895},{"type":41,"tag":685,"props":1898,"children":1899},{"style":719},[1900],{"type":47,"value":900},{"type":41,"tag":685,"props":1902,"children":1903},{"style":903},[1904],{"type":47,"value":365},{"type":41,"tag":685,"props":1906,"children":1907},{"style":719},[1908],{"type":47,"value":910},{"type":41,"tag":685,"props":1910,"children":1911},{"style":708},[1912],{"type":47,"value":915},{"type":41,"tag":685,"props":1914,"children":1915},{"style":719},[1916],{"type":47,"value":1482},{"type":41,"tag":685,"props":1918,"children":1919},{"style":708},[1920],{"type":47,"value":1921}," contractJson",{"type":41,"tag":685,"props":1923,"children":1924},{"style":719},[1925],{"type":47,"value":1509},{"type":41,"tag":685,"props":1927,"children":1928},{"style":829},[1929],{"type":47,"value":1930}," url",{"type":41,"tag":685,"props":1932,"children":1933},{"style":719},[1934],{"type":47,"value":836},{"type":41,"tag":685,"props":1936,"children":1937},{"style":708},[1938],{"type":47,"value":952},{"type":41,"tag":685,"props":1940,"children":1941},{"style":719},[1942],{"type":47,"value":184},{"type":41,"tag":685,"props":1944,"children":1945},{"style":708},[1946],{"type":47,"value":1947},"env",{"type":41,"tag":685,"props":1949,"children":1950},{"style":719},[1951],{"type":47,"value":184},{"type":41,"tag":685,"props":1953,"children":1954},{"style":708},[1955],{"type":47,"value":561},{"type":41,"tag":685,"props":1957,"children":1958},{"style":719},[1959],{"type":47,"value":1960},"!",{"type":41,"tag":685,"props":1962,"children":1963},{"style":719},[1964],{"type":47,"value":765},{"type":41,"tag":685,"props":1966,"children":1967},{"style":708},[1968],{"type":47,"value":996},{"type":41,"tag":685,"props":1970,"children":1971},{"style":719},[1972],{"type":47,"value":737},{"type":41,"tag":685,"props":1974,"children":1975},{"class":687,"line":923},[1976],{"type":41,"tag":685,"props":1977,"children":1978},{"emptyLinePlaceholder":861},[1979],{"type":47,"value":864},{"type":41,"tag":685,"props":1981,"children":1982},{"class":687,"line":937},[1983,1987,1992,1996,2000,2004,2008,2012,2016,2020,2024,2028,2032],{"type":41,"tag":685,"props":1984,"children":1985},{"style":876},[1986],{"type":47,"value":1428},{"type":41,"tag":685,"props":1988,"children":1989},{"style":708},[1990],{"type":47,"value":1991}," user ",{"type":41,"tag":685,"props":1993,"children":1994},{"style":719},[1995],{"type":47,"value":889},{"type":41,"tag":685,"props":1997,"children":1998},{"style":702},[1999],{"type":47,"value":1442},{"type":41,"tag":685,"props":2001,"children":2002},{"style":708},[2003],{"type":47,"value":1389},{"type":41,"tag":685,"props":2005,"children":2006},{"style":719},[2007],{"type":47,"value":184},{"type":41,"tag":685,"props":2009,"children":2010},{"style":708},[2011],{"type":47,"value":1455},{"type":41,"tag":685,"props":2013,"children":2014},{"style":719},[2015],{"type":47,"value":184},{"type":41,"tag":685,"props":2017,"children":2018},{"style":708},[2019],{"type":47,"value":1464},{"type":41,"tag":685,"props":2021,"children":2022},{"style":719},[2023],{"type":47,"value":184},{"type":41,"tag":685,"props":2025,"children":2026},{"style":892},[2027],{"type":47,"value":1592},{"type":41,"tag":685,"props":2029,"children":2030},{"style":708},[2031],{"type":47,"value":1597},{"type":41,"tag":685,"props":2033,"children":2034},{"style":719},[2035],{"type":47,"value":737},{"type":41,"tag":685,"props":2037,"children":2038},{"class":687,"line":985},[2039,2043,2047,2051,2056],{"type":41,"tag":685,"props":2040,"children":2041},{"style":708},[2042],{"type":47,"value":1609},{"type":41,"tag":685,"props":2044,"children":2045},{"style":719},[2046],{"type":47,"value":184},{"type":41,"tag":685,"props":2048,"children":2049},{"style":892},[2050],{"type":47,"value":1618},{"type":41,"tag":685,"props":2052,"children":2053},{"style":708},[2054],{"type":47,"value":2055},"(user)",{"type":41,"tag":685,"props":2057,"children":2058},{"style":719},[2059],{"type":47,"value":737},{"type":41,"tag":685,"props":2061,"children":2063},{"class":687,"line":2062},10,[2064],{"type":41,"tag":685,"props":2065,"children":2066},{"style":692},[2067],{"type":47,"value":2068},"\u002F\u002F db.close() runs automatically when the script module exits.\n",{"type":41,"tag":2070,"props":2071,"children":2073},"h3",{"id":2072},"await-using-is-block-scoped-do-not-put-it-inside-a-request-handler",[2074,2079,2080,2085],{"type":41,"tag":50,"props":2075,"children":2077},{"className":2076},[],[2078],{"type":47,"value":169},{"type":47,"value":1265},{"type":41,"tag":67,"props":2081,"children":2082},{},[2083],{"type":47,"value":2084},"block-scoped",{"type":47,"value":2086}," — do not put it inside a request handler",{"type":41,"tag":63,"props":2088,"children":2089},{},[2090,2092,2098,2100,2105,2107,2112,2114,2119],{"type":47,"value":2091},"This is the most important rule in this section. ",{"type":41,"tag":50,"props":2093,"children":2095},{"className":2094},[],[2096],{"type":47,"value":2097},"await using db = postgres(...)",{"type":47,"value":2099}," disposes when the ",{"type":41,"tag":178,"props":2101,"children":2102},{},[2103],{"type":47,"value":2104},"enclosing block",{"type":47,"value":2106}," exits. In a script module, that block is the module body and disposal fires at process exit — fine. In a request handler, the enclosing block is the handler function, so disposal fires ",{"type":41,"tag":67,"props":2108,"children":2109},{},[2110],{"type":47,"value":2111},"after every request",{"type":47,"value":2113}," — a fresh ",{"type":41,"tag":50,"props":2115,"children":2117},{"className":2116},[],[2118],{"type":47,"value":1311},{"type":47,"value":2120}," per call, TCP-connect storm, hot loop tearing connections up and down.",{"type":41,"tag":674,"props":2122,"children":2124},{"className":676,"code":2123,"language":678,"meta":679,"style":679},"\u002F\u002F DO NOT do this — closes the pool after every request.\napp.get('\u002Fusers', async (req, res) => {\n  await using db = postgres\u003CContract>({ contractJson, url: process.env.DATABASE_URL! });\n  const users = await db.orm.User.all();\n  res.json(users);\n});\n",[2125],{"type":41,"tag":50,"props":2126,"children":2127},{"__ignoreMap":679},[2128,2136,2213,2306,2364,2397],{"type":41,"tag":685,"props":2129,"children":2130},{"class":687,"line":688},[2131],{"type":41,"tag":685,"props":2132,"children":2133},{"style":692},[2134],{"type":47,"value":2135},"\u002F\u002F DO NOT do this — closes the pool after every request.\n",{"type":41,"tag":685,"props":2137,"children":2138},{"class":687,"line":698},[2139,2144,2148,2153,2157,2161,2166,2170,2174,2179,2184,2190,2194,2199,2203,2208],{"type":41,"tag":685,"props":2140,"children":2141},{"style":708},[2142],{"type":47,"value":2143},"app",{"type":41,"tag":685,"props":2145,"children":2146},{"style":719},[2147],{"type":47,"value":184},{"type":41,"tag":685,"props":2149,"children":2150},{"style":892},[2151],{"type":47,"value":2152},"get",{"type":41,"tag":685,"props":2154,"children":2155},{"style":708},[2156],{"type":47,"value":915},{"type":41,"tag":685,"props":2158,"children":2159},{"style":719},[2160],{"type":47,"value":732},{"type":41,"tag":685,"props":2162,"children":2163},{"style":725},[2164],{"type":47,"value":2165},"\u002Fusers",{"type":41,"tag":685,"props":2167,"children":2168},{"style":719},[2169],{"type":47,"value":732},{"type":41,"tag":685,"props":2171,"children":2172},{"style":719},[2173],{"type":47,"value":1509},{"type":41,"tag":685,"props":2175,"children":2176},{"style":876},[2177],{"type":47,"value":2178}," async",{"type":41,"tag":685,"props":2180,"children":2181},{"style":719},[2182],{"type":47,"value":2183}," (",{"type":41,"tag":685,"props":2185,"children":2187},{"style":2186},"--shiki-light:#90A4AE;--shiki-light-font-style:italic;--shiki-default:#EEFFFF;--shiki-default-font-style:italic;--shiki-dark:#BABED8;--shiki-dark-font-style:italic",[2188],{"type":47,"value":2189},"req",{"type":41,"tag":685,"props":2191,"children":2192},{"style":719},[2193],{"type":47,"value":1509},{"type":41,"tag":685,"props":2195,"children":2196},{"style":2186},[2197],{"type":47,"value":2198}," res",{"type":41,"tag":685,"props":2200,"children":2201},{"style":719},[2202],{"type":47,"value":996},{"type":41,"tag":685,"props":2204,"children":2205},{"style":876},[2206],{"type":47,"value":2207}," =>",{"type":41,"tag":685,"props":2209,"children":2210},{"style":719},[2211],{"type":47,"value":2212}," {\n",{"type":41,"tag":685,"props":2214,"children":2215},{"class":687,"line":740},[2216,2221,2225,2230,2234,2238,2242,2246,2250,2254,2258,2262,2266,2270,2274,2278,2282,2286,2290,2294,2298,2302],{"type":41,"tag":685,"props":2217,"children":2218},{"style":876},[2219],{"type":47,"value":2220},"  await using",{"type":41,"tag":685,"props":2222,"children":2223},{"style":708},[2224],{"type":47,"value":1389},{"type":41,"tag":685,"props":2226,"children":2227},{"style":719},[2228],{"type":47,"value":2229}," =",{"type":41,"tag":685,"props":2231,"children":2232},{"style":892},[2233],{"type":47,"value":895},{"type":41,"tag":685,"props":2235,"children":2236},{"style":719},[2237],{"type":47,"value":900},{"type":41,"tag":685,"props":2239,"children":2240},{"style":903},[2241],{"type":47,"value":365},{"type":41,"tag":685,"props":2243,"children":2244},{"style":719},[2245],{"type":47,"value":910},{"type":41,"tag":685,"props":2247,"children":2248},{"style":829},[2249],{"type":47,"value":915},{"type":41,"tag":685,"props":2251,"children":2252},{"style":719},[2253],{"type":47,"value":1482},{"type":41,"tag":685,"props":2255,"children":2256},{"style":708},[2257],{"type":47,"value":1921},{"type":41,"tag":685,"props":2259,"children":2260},{"style":719},[2261],{"type":47,"value":1509},{"type":41,"tag":685,"props":2263,"children":2264},{"style":829},[2265],{"type":47,"value":1930},{"type":41,"tag":685,"props":2267,"children":2268},{"style":719},[2269],{"type":47,"value":836},{"type":41,"tag":685,"props":2271,"children":2272},{"style":708},[2273],{"type":47,"value":952},{"type":41,"tag":685,"props":2275,"children":2276},{"style":719},[2277],{"type":47,"value":184},{"type":41,"tag":685,"props":2279,"children":2280},{"style":708},[2281],{"type":47,"value":1947},{"type":41,"tag":685,"props":2283,"children":2284},{"style":719},[2285],{"type":47,"value":184},{"type":41,"tag":685,"props":2287,"children":2288},{"style":708},[2289],{"type":47,"value":561},{"type":41,"tag":685,"props":2291,"children":2292},{"style":719},[2293],{"type":47,"value":1960},{"type":41,"tag":685,"props":2295,"children":2296},{"style":719},[2297],{"type":47,"value":765},{"type":41,"tag":685,"props":2299,"children":2300},{"style":829},[2301],{"type":47,"value":996},{"type":41,"tag":685,"props":2303,"children":2304},{"style":719},[2305],{"type":47,"value":737},{"type":41,"tag":685,"props":2307,"children":2308},{"class":687,"line":790},[2309,2314,2319,2323,2327,2331,2335,2339,2343,2347,2351,2356,2360],{"type":41,"tag":685,"props":2310,"children":2311},{"style":876},[2312],{"type":47,"value":2313},"  const",{"type":41,"tag":685,"props":2315,"children":2316},{"style":708},[2317],{"type":47,"value":2318}," users",{"type":41,"tag":685,"props":2320,"children":2321},{"style":719},[2322],{"type":47,"value":2229},{"type":41,"tag":685,"props":2324,"children":2325},{"style":702},[2326],{"type":47,"value":1442},{"type":41,"tag":685,"props":2328,"children":2329},{"style":708},[2330],{"type":47,"value":1389},{"type":41,"tag":685,"props":2332,"children":2333},{"style":719},[2334],{"type":47,"value":184},{"type":41,"tag":685,"props":2336,"children":2337},{"style":708},[2338],{"type":47,"value":1455},{"type":41,"tag":685,"props":2340,"children":2341},{"style":719},[2342],{"type":47,"value":184},{"type":41,"tag":685,"props":2344,"children":2345},{"style":708},[2346],{"type":47,"value":1464},{"type":41,"tag":685,"props":2348,"children":2349},{"style":719},[2350],{"type":47,"value":184},{"type":41,"tag":685,"props":2352,"children":2353},{"style":892},[2354],{"type":47,"value":2355},"all",{"type":41,"tag":685,"props":2357,"children":2358},{"style":829},[2359],{"type":47,"value":1597},{"type":41,"tag":685,"props":2361,"children":2362},{"style":719},[2363],{"type":47,"value":737},{"type":41,"tag":685,"props":2365,"children":2366},{"class":687,"line":857},[2367,2372,2376,2380,2384,2389,2393],{"type":41,"tag":685,"props":2368,"children":2369},{"style":708},[2370],{"type":47,"value":2371},"  res",{"type":41,"tag":685,"props":2373,"children":2374},{"style":719},[2375],{"type":47,"value":184},{"type":41,"tag":685,"props":2377,"children":2378},{"style":892},[2379],{"type":47,"value":845},{"type":41,"tag":685,"props":2381,"children":2382},{"style":829},[2383],{"type":47,"value":915},{"type":41,"tag":685,"props":2385,"children":2386},{"style":708},[2387],{"type":47,"value":2388},"users",{"type":41,"tag":685,"props":2390,"children":2391},{"style":829},[2392],{"type":47,"value":996},{"type":41,"tag":685,"props":2394,"children":2395},{"style":719},[2396],{"type":47,"value":737},{"type":41,"tag":685,"props":2398,"children":2399},{"class":687,"line":867},[2400,2404,2408],{"type":41,"tag":685,"props":2401,"children":2402},{"style":719},[2403],{"type":47,"value":991},{"type":41,"tag":685,"props":2405,"children":2406},{"style":708},[2407],{"type":47,"value":996},{"type":41,"tag":685,"props":2409,"children":2410},{"style":719},[2411],{"type":47,"value":737},{"type":41,"tag":63,"props":2413,"children":2414},{},[2415,2417,2422,2424,2429],{"type":47,"value":2416},"The right server pattern is a ",{"type":41,"tag":67,"props":2418,"children":2419},{},[2420],{"type":47,"value":2421},"module-level singleton",{"type":47,"value":2423}," in ",{"type":41,"tag":50,"props":2425,"children":2427},{"className":2426},[],[2428],{"type":47,"value":55},{"type":47,"value":2430},", imported by handlers, never closed during the process lifetime:",{"type":41,"tag":674,"props":2432,"children":2434},{"className":676,"code":2433,"language":678,"meta":679,"style":679},"\u002F\u002F src\u002Fprisma\u002Fdb.ts — constructed once, lives for the process\nexport const db = postgres\u003CContract>({ contractJson, url: process.env.DATABASE_URL });\n\n\u002F\u002F src\u002Froutes\u002Fusers.ts\nimport { db } from '..\u002Fprisma\u002Fdb';\n\napp.get('\u002Fusers', async (req, res) => {\n  const users = await db.orm.User.all();\n  res.json(users);\n});\n",[2435],{"type":41,"tag":50,"props":2436,"children":2437},{"__ignoreMap":679},[2438,2446,2538,2545,2553,2592,2599,2666,2721,2752],{"type":41,"tag":685,"props":2439,"children":2440},{"class":687,"line":688},[2441],{"type":41,"tag":685,"props":2442,"children":2443},{"style":692},[2444],{"type":47,"value":2445},"\u002F\u002F src\u002Fprisma\u002Fdb.ts — constructed once, lives for the process\n",{"type":41,"tag":685,"props":2447,"children":2448},{"class":687,"line":698},[2449,2453,2457,2461,2465,2469,2473,2477,2481,2485,2489,2493,2497,2501,2505,2509,2513,2517,2521,2526,2530,2534],{"type":41,"tag":685,"props":2450,"children":2451},{"style":702},[2452],{"type":47,"value":873},{"type":41,"tag":685,"props":2454,"children":2455},{"style":876},[2456],{"type":47,"value":879},{"type":41,"tag":685,"props":2458,"children":2459},{"style":708},[2460],{"type":47,"value":884},{"type":41,"tag":685,"props":2462,"children":2463},{"style":719},[2464],{"type":47,"value":889},{"type":41,"tag":685,"props":2466,"children":2467},{"style":892},[2468],{"type":47,"value":895},{"type":41,"tag":685,"props":2470,"children":2471},{"style":719},[2472],{"type":47,"value":900},{"type":41,"tag":685,"props":2474,"children":2475},{"style":903},[2476],{"type":47,"value":365},{"type":41,"tag":685,"props":2478,"children":2479},{"style":719},[2480],{"type":47,"value":910},{"type":41,"tag":685,"props":2482,"children":2483},{"style":708},[2484],{"type":47,"value":915},{"type":41,"tag":685,"props":2486,"children":2487},{"style":719},[2488],{"type":47,"value":1482},{"type":41,"tag":685,"props":2490,"children":2491},{"style":708},[2492],{"type":47,"value":1921},{"type":41,"tag":685,"props":2494,"children":2495},{"style":719},[2496],{"type":47,"value":1509},{"type":41,"tag":685,"props":2498,"children":2499},{"style":829},[2500],{"type":47,"value":1930},{"type":41,"tag":685,"props":2502,"children":2503},{"style":719},[2504],{"type":47,"value":836},{"type":41,"tag":685,"props":2506,"children":2507},{"style":708},[2508],{"type":47,"value":952},{"type":41,"tag":685,"props":2510,"children":2511},{"style":719},[2512],{"type":47,"value":184},{"type":41,"tag":685,"props":2514,"children":2515},{"style":708},[2516],{"type":47,"value":1947},{"type":41,"tag":685,"props":2518,"children":2519},{"style":719},[2520],{"type":47,"value":184},{"type":41,"tag":685,"props":2522,"children":2523},{"style":708},[2524],{"type":47,"value":2525},"DATABASE_URL ",{"type":41,"tag":685,"props":2527,"children":2528},{"style":719},[2529],{"type":47,"value":991},{"type":41,"tag":685,"props":2531,"children":2532},{"style":708},[2533],{"type":47,"value":996},{"type":41,"tag":685,"props":2535,"children":2536},{"style":719},[2537],{"type":47,"value":737},{"type":41,"tag":685,"props":2539,"children":2540},{"class":687,"line":740},[2541],{"type":41,"tag":685,"props":2542,"children":2543},{"emptyLinePlaceholder":861},[2544],{"type":47,"value":864},{"type":41,"tag":685,"props":2546,"children":2547},{"class":687,"line":790},[2548],{"type":41,"tag":685,"props":2549,"children":2550},{"style":692},[2551],{"type":47,"value":2552},"\u002F\u002F src\u002Froutes\u002Fusers.ts\n",{"type":41,"tag":685,"props":2554,"children":2555},{"class":687,"line":857},[2556,2560,2564,2568,2572,2576,2580,2584,2588],{"type":41,"tag":685,"props":2557,"children":2558},{"style":702},[2559],{"type":47,"value":705},{"type":41,"tag":685,"props":2561,"children":2562},{"style":719},[2563],{"type":47,"value":755},{"type":41,"tag":685,"props":2565,"children":2566},{"style":708},[2567],{"type":47,"value":1389},{"type":41,"tag":685,"props":2569,"children":2570},{"style":719},[2571],{"type":47,"value":765},{"type":41,"tag":685,"props":2573,"children":2574},{"style":702},[2575],{"type":47,"value":770},{"type":41,"tag":685,"props":2577,"children":2578},{"style":719},[2579],{"type":47,"value":722},{"type":41,"tag":685,"props":2581,"children":2582},{"style":725},[2583],{"type":47,"value":1057},{"type":41,"tag":685,"props":2585,"children":2586},{"style":719},[2587],{"type":47,"value":732},{"type":41,"tag":685,"props":2589,"children":2590},{"style":719},[2591],{"type":47,"value":737},{"type":41,"tag":685,"props":2593,"children":2594},{"class":687,"line":867},[2595],{"type":41,"tag":685,"props":2596,"children":2597},{"emptyLinePlaceholder":861},[2598],{"type":47,"value":864},{"type":41,"tag":685,"props":2600,"children":2601},{"class":687,"line":923},[2602,2606,2610,2614,2618,2622,2626,2630,2634,2638,2642,2646,2650,2654,2658,2662],{"type":41,"tag":685,"props":2603,"children":2604},{"style":708},[2605],{"type":47,"value":2143},{"type":41,"tag":685,"props":2607,"children":2608},{"style":719},[2609],{"type":47,"value":184},{"type":41,"tag":685,"props":2611,"children":2612},{"style":892},[2613],{"type":47,"value":2152},{"type":41,"tag":685,"props":2615,"children":2616},{"style":708},[2617],{"type":47,"value":915},{"type":41,"tag":685,"props":2619,"children":2620},{"style":719},[2621],{"type":47,"value":732},{"type":41,"tag":685,"props":2623,"children":2624},{"style":725},[2625],{"type":47,"value":2165},{"type":41,"tag":685,"props":2627,"children":2628},{"style":719},[2629],{"type":47,"value":732},{"type":41,"tag":685,"props":2631,"children":2632},{"style":719},[2633],{"type":47,"value":1509},{"type":41,"tag":685,"props":2635,"children":2636},{"style":876},[2637],{"type":47,"value":2178},{"type":41,"tag":685,"props":2639,"children":2640},{"style":719},[2641],{"type":47,"value":2183},{"type":41,"tag":685,"props":2643,"children":2644},{"style":2186},[2645],{"type":47,"value":2189},{"type":41,"tag":685,"props":2647,"children":2648},{"style":719},[2649],{"type":47,"value":1509},{"type":41,"tag":685,"props":2651,"children":2652},{"style":2186},[2653],{"type":47,"value":2198},{"type":41,"tag":685,"props":2655,"children":2656},{"style":719},[2657],{"type":47,"value":996},{"type":41,"tag":685,"props":2659,"children":2660},{"style":876},[2661],{"type":47,"value":2207},{"type":41,"tag":685,"props":2663,"children":2664},{"style":719},[2665],{"type":47,"value":2212},{"type":41,"tag":685,"props":2667,"children":2668},{"class":687,"line":937},[2669,2673,2677,2681,2685,2689,2693,2697,2701,2705,2709,2713,2717],{"type":41,"tag":685,"props":2670,"children":2671},{"style":876},[2672],{"type":47,"value":2313},{"type":41,"tag":685,"props":2674,"children":2675},{"style":708},[2676],{"type":47,"value":2318},{"type":41,"tag":685,"props":2678,"children":2679},{"style":719},[2680],{"type":47,"value":2229},{"type":41,"tag":685,"props":2682,"children":2683},{"style":702},[2684],{"type":47,"value":1442},{"type":41,"tag":685,"props":2686,"children":2687},{"style":708},[2688],{"type":47,"value":1389},{"type":41,"tag":685,"props":2690,"children":2691},{"style":719},[2692],{"type":47,"value":184},{"type":41,"tag":685,"props":2694,"children":2695},{"style":708},[2696],{"type":47,"value":1455},{"type":41,"tag":685,"props":2698,"children":2699},{"style":719},[2700],{"type":47,"value":184},{"type":41,"tag":685,"props":2702,"children":2703},{"style":708},[2704],{"type":47,"value":1464},{"type":41,"tag":685,"props":2706,"children":2707},{"style":719},[2708],{"type":47,"value":184},{"type":41,"tag":685,"props":2710,"children":2711},{"style":892},[2712],{"type":47,"value":2355},{"type":41,"tag":685,"props":2714,"children":2715},{"style":829},[2716],{"type":47,"value":1597},{"type":41,"tag":685,"props":2718,"children":2719},{"style":719},[2720],{"type":47,"value":737},{"type":41,"tag":685,"props":2722,"children":2723},{"class":687,"line":985},[2724,2728,2732,2736,2740,2744,2748],{"type":41,"tag":685,"props":2725,"children":2726},{"style":708},[2727],{"type":47,"value":2371},{"type":41,"tag":685,"props":2729,"children":2730},{"style":719},[2731],{"type":47,"value":184},{"type":41,"tag":685,"props":2733,"children":2734},{"style":892},[2735],{"type":47,"value":845},{"type":41,"tag":685,"props":2737,"children":2738},{"style":829},[2739],{"type":47,"value":915},{"type":41,"tag":685,"props":2741,"children":2742},{"style":708},[2743],{"type":47,"value":2388},{"type":41,"tag":685,"props":2745,"children":2746},{"style":829},[2747],{"type":47,"value":996},{"type":41,"tag":685,"props":2749,"children":2750},{"style":719},[2751],{"type":47,"value":737},{"type":41,"tag":685,"props":2753,"children":2754},{"class":687,"line":2062},[2755,2759,2763],{"type":41,"tag":685,"props":2756,"children":2757},{"style":719},[2758],{"type":47,"value":991},{"type":41,"tag":685,"props":2760,"children":2761},{"style":708},[2762],{"type":47,"value":996},{"type":41,"tag":685,"props":2764,"children":2765},{"style":719},[2766],{"type":47,"value":737},{"type":41,"tag":63,"props":2768,"children":2769},{},[2770,2772,2782,2784,2789,2791,2796,2798,2803],{"type":47,"value":2771},"Servers (HTTP handlers, workers in a request loop) ",{"type":41,"tag":67,"props":2773,"children":2774},{},[2775,2777],{"type":47,"value":2776},"do not call ",{"type":41,"tag":50,"props":2778,"children":2780},{"className":2779},[],[2781],{"type":47,"value":161},{"type":47,"value":2783}," at all in steady state. The pool stays open for the process lifetime. ",{"type":41,"tag":50,"props":2785,"children":2787},{"className":2786},[],[2788],{"type":47,"value":161},{"type":47,"value":2790}," and ",{"type":41,"tag":50,"props":2792,"children":2794},{"className":2793},[],[2795],{"type":47,"value":169},{"type":47,"value":2797}," are for short-lived scripts — ",{"type":41,"tag":50,"props":2799,"children":2801},{"className":2800},[],[2802],{"type":47,"value":153},{"type":47,"value":2804},", Node CLI commands, CI tasks, one-off seed runs — not for code that runs inside a request loop.",{"type":41,"tag":63,"props":2806,"children":2807},{},[2808],{"type":41,"tag":67,"props":2809,"children":2810},{},[2811],{"type":47,"value":2812},"Semantics:",{"type":41,"tag":99,"props":2814,"children":2815},{},[2816,2831,2910,2960],{"type":41,"tag":103,"props":2817,"children":2818},{},[2819,2829],{"type":41,"tag":67,"props":2820,"children":2821},{},[2822,2827],{"type":41,"tag":50,"props":2823,"children":2825},{"className":2824},[],[2826],{"type":47,"value":1718},{"type":47,"value":2828}," is idempotent.",{"type":47,"value":2830}," Calling it twice is a no-op.",{"type":41,"tag":103,"props":2832,"children":2833},{},[2834,2844,2846,2851,2853,2859,2860,2865,2866,2871,2873,2879,2881,2887,2889,2895,2896,2902,2903,2909],{"type":41,"tag":67,"props":2835,"children":2836},{},[2837,2842],{"type":41,"tag":50,"props":2838,"children":2840},{"className":2839},[],[2841],{"type":47,"value":1718},{"type":47,"value":2843}," is terminal.",{"type":47,"value":2845}," There is no reconnect on a closed ",{"type":41,"tag":50,"props":2847,"children":2849},{"className":2848},[],[2850],{"type":47,"value":381},{"type":47,"value":2852}," — construct a new client if you need another connection. After close, ",{"type":41,"tag":50,"props":2854,"children":2856},{"className":2855},[],[2857],{"type":47,"value":2858},"db.runtime()",{"type":47,"value":163},{"type":41,"tag":50,"props":2861,"children":2863},{"className":2862},[],[2864],{"type":47,"value":1168},{"type":47,"value":163},{"type":41,"tag":50,"props":2867,"children":2869},{"className":2868},[],[2870],{"type":47,"value":140},{"type":47,"value":2872},", and ",{"type":41,"tag":50,"props":2874,"children":2876},{"className":2875},[],[2877],{"type":47,"value":2878},"db.prepare(...)",{"type":47,"value":2880}," reject with ",{"type":41,"tag":50,"props":2882,"children":2884},{"className":2883},[],[2885],{"type":47,"value":2886},"Error('\u003Ctarget> client is closed')",{"type":47,"value":2888}," (e.g. ",{"type":41,"tag":50,"props":2890,"children":2892},{"className":2891},[],[2893],{"type":47,"value":2894},"'Postgres client is closed'",{"type":47,"value":163},{"type":41,"tag":50,"props":2897,"children":2899},{"className":2898},[],[2900],{"type":47,"value":2901},"'SQLite client is closed'",{"type":47,"value":163},{"type":41,"tag":50,"props":2904,"children":2906},{"className":2905},[],[2907],{"type":47,"value":2908},"'Mongo client is closed'",{"type":47,"value":171},{"type":41,"tag":103,"props":2911,"children":2912},{},[2913,2923,2924,2929,2931,2936,2938,2944,2945,2951,2953,2958],{"type":41,"tag":67,"props":2914,"children":2915},{},[2916,2921],{"type":41,"tag":50,"props":2917,"children":2919},{"className":2918},[],[2920],{"type":47,"value":1718},{"type":47,"value":2922}," does not abort in-flight queries.",{"type":47,"value":595},{"type":41,"tag":50,"props":2925,"children":2927},{"className":2926},[],[2928],{"type":47,"value":1666},{"type":47,"value":2930}," outstanding work before calling ",{"type":41,"tag":50,"props":2932,"children":2934},{"className":2933},[],[2935],{"type":47,"value":1718},{"type":47,"value":2937},". Async iterators from ",{"type":41,"tag":50,"props":2939,"children":2941},{"className":2940},[],[2942],{"type":47,"value":2943},"db.runtime().execute(plan)",{"type":47,"value":2790},{"type":41,"tag":50,"props":2946,"children":2948},{"className":2947},[],[2949],{"type":47,"value":2950},"PreparedStatement",{"type":47,"value":2952}," handles held after ",{"type":41,"tag":50,"props":2954,"children":2956},{"className":2955},[],[2957],{"type":47,"value":1718},{"type":47,"value":2959}," fail on their next call.",{"type":41,"tag":103,"props":2961,"children":2962},{},[2963,2968,2969,2974,2976,2981,2982,2988,2989,2995,2996,3001,3002,3008,3010,3016,3018,3023,3024,3030,3032,3038,3040,3046,3048,3054,3056,3062,3063,3068,3070,3075],{"type":41,"tag":67,"props":2964,"children":2965},{},[2966],{"type":47,"value":2967},"Ownership.",{"type":47,"value":595},{"type":41,"tag":50,"props":2970,"children":2972},{"className":2971},[],[2973],{"type":47,"value":1718},{"type":47,"value":2975}," releases only what the façade constructed (",{"type":41,"tag":50,"props":2977,"children":2979},{"className":2978},[],[2980],{"type":47,"value":1311},{"type":47,"value":1351},{"type":41,"tag":50,"props":2983,"children":2985},{"className":2984},[],[2986],{"type":47,"value":2987},"{ url }",{"type":47,"value":163},{"type":41,"tag":50,"props":2990,"children":2992},{"className":2991},[],[2993],{"type":47,"value":2994},"MongoClient",{"type":47,"value":1351},{"type":41,"tag":50,"props":2997,"children":2999},{"className":2998},[],[3000],{"type":47,"value":2987},{"type":47,"value":226},{"type":41,"tag":50,"props":3003,"children":3005},{"className":3004},[],[3006],{"type":47,"value":3007},"{ uri, dbName }",{"type":47,"value":3009},", SQLite handle from ",{"type":41,"tag":50,"props":3011,"children":3013},{"className":3012},[],[3014],{"type":47,"value":3015},"{ path }",{"type":47,"value":3017},"). If you supplied your own ",{"type":41,"tag":50,"props":3019,"children":3021},{"className":3020},[],[3022],{"type":47,"value":1311},{"type":47,"value":226},{"type":41,"tag":50,"props":3025,"children":3027},{"className":3026},[],[3028],{"type":47,"value":3029},"pg.Client",{"type":47,"value":3031}," (Postgres ",{"type":41,"tag":50,"props":3033,"children":3035},{"className":3034},[],[3036],{"type":47,"value":3037},"pg:",{"type":47,"value":3039}," option), ",{"type":41,"tag":50,"props":3041,"children":3043},{"className":3042},[],[3044],{"type":47,"value":3045},"mongodb.MongoClient",{"type":47,"value":3047}," (Mongo ",{"type":41,"tag":50,"props":3049,"children":3051},{"className":3050},[],[3052],{"type":47,"value":3053},"mongoClient:",{"type":47,"value":3055}," option), or a pre-built ",{"type":41,"tag":50,"props":3057,"children":3059},{"className":3058},[],[3060],{"type":47,"value":3061},"binding",{"type":47,"value":163},{"type":41,"tag":50,"props":3064,"children":3066},{"className":3065},[],[3067],{"type":47,"value":161},{"type":47,"value":3069}," does ",{"type":41,"tag":67,"props":3071,"children":3072},{},[3073],{"type":47,"value":3074},"not",{"type":47,"value":3076}," touch those — you own their lifecycle.",{"type":41,"tag":63,"props":3078,"children":3079},{},[3080,3091,3093,3099,3101,3107,3109,3114,3116,3121,3123,3128],{"type":41,"tag":67,"props":3081,"children":3082},{},[3083,3089],{"type":41,"tag":50,"props":3084,"children":3086},{"className":3085},[],[3087],{"type":47,"value":3088},"db.end()",{"type":47,"value":3090}," does not exist.",{"type":47,"value":3092}," The universal ",{"type":41,"tag":50,"props":3094,"children":3096},{"className":3095},[],[3097],{"type":47,"value":3098},"node-postgres",{"type":47,"value":3100}," name is ",{"type":41,"tag":50,"props":3102,"children":3104},{"className":3103},[],[3105],{"type":47,"value":3106},"pool.end()",{"type":47,"value":3108}," on a ",{"type":41,"tag":50,"props":3110,"children":3112},{"className":3111},[],[3113],{"type":47,"value":1311},{"type":47,"value":3115},"; the Prisma Next runtime client is not a ",{"type":41,"tag":50,"props":3117,"children":3119},{"className":3118},[],[3120],{"type":47,"value":1311},{"type":47,"value":3122},". The right call is ",{"type":41,"tag":50,"props":3124,"children":3126},{"className":3125},[],[3127],{"type":47,"value":1319},{"type":47,"value":184},{"type":41,"tag":92,"props":3130,"children":3132},{"id":3131},"workflow-telemetry-middleware",[3133],{"type":47,"value":3134},"Workflow — Telemetry middleware",{"type":41,"tag":63,"props":3136,"children":3137},{},[3138],{"type":47,"value":3139},"The concept: telemetry middleware sees every operation and emits a structured event for each (start, success, error). Pair the events with your observability stack's collector.",{"type":41,"tag":674,"props":3141,"children":3143},{"className":676,"code":3142,"language":678,"meta":679,"style":679},"import postgres from '@prisma-next\u002Fpostgres\u002Fruntime';\nimport { createTelemetryMiddleware } from '@prisma-next\u002Fmiddleware-telemetry';\nimport type { Contract } from '.\u002Fcontract.d';\nimport contractJson from '.\u002Fcontract.json' with { type: 'json' };\n\nexport const db = postgres\u003CContract>({\n  contractJson,\n  url: process.env['DATABASE_URL'],\n  middleware: [\n    createTelemetryMiddleware({\n      onEvent: (event) => {\n        \u002F\u002F forward to your collector, log, etc.\n      },\n    }),\n  ],\n});\n",[3144],{"type":41,"tag":50,"props":3145,"children":3146},{"__ignoreMap":679},[3147,3178,3219,3262,3321,3328,3371,3382,3425,3442,3458,3492,3501,3510,3527,3539],{"type":41,"tag":685,"props":3148,"children":3149},{"class":687,"line":688},[3150,3154,3158,3162,3166,3170,3174],{"type":41,"tag":685,"props":3151,"children":3152},{"style":702},[3153],{"type":47,"value":705},{"type":41,"tag":685,"props":3155,"children":3156},{"style":708},[3157],{"type":47,"value":711},{"type":41,"tag":685,"props":3159,"children":3160},{"style":702},[3161],{"type":47,"value":716},{"type":41,"tag":685,"props":3163,"children":3164},{"style":719},[3165],{"type":47,"value":722},{"type":41,"tag":685,"props":3167,"children":3168},{"style":725},[3169],{"type":47,"value":334},{"type":41,"tag":685,"props":3171,"children":3172},{"style":719},[3173],{"type":47,"value":732},{"type":41,"tag":685,"props":3175,"children":3176},{"style":719},[3177],{"type":47,"value":737},{"type":41,"tag":685,"props":3179,"children":3180},{"class":687,"line":698},[3181,3185,3189,3194,3198,3202,3206,3211,3215],{"type":41,"tag":685,"props":3182,"children":3183},{"style":702},[3184],{"type":47,"value":705},{"type":41,"tag":685,"props":3186,"children":3187},{"style":719},[3188],{"type":47,"value":755},{"type":41,"tag":685,"props":3190,"children":3191},{"style":708},[3192],{"type":47,"value":3193}," createTelemetryMiddleware",{"type":41,"tag":685,"props":3195,"children":3196},{"style":719},[3197],{"type":47,"value":765},{"type":41,"tag":685,"props":3199,"children":3200},{"style":702},[3201],{"type":47,"value":770},{"type":41,"tag":685,"props":3203,"children":3204},{"style":719},[3205],{"type":47,"value":722},{"type":41,"tag":685,"props":3207,"children":3208},{"style":725},[3209],{"type":47,"value":3210},"@prisma-next\u002Fmiddleware-telemetry",{"type":41,"tag":685,"props":3212,"children":3213},{"style":719},[3214],{"type":47,"value":732},{"type":41,"tag":685,"props":3216,"children":3217},{"style":719},[3218],{"type":47,"value":737},{"type":41,"tag":685,"props":3220,"children":3221},{"class":687,"line":740},[3222,3226,3230,3234,3238,3242,3246,3250,3254,3258],{"type":41,"tag":685,"props":3223,"children":3224},{"style":702},[3225],{"type":47,"value":705},{"type":41,"tag":685,"props":3227,"children":3228},{"style":702},[3229],{"type":47,"value":750},{"type":41,"tag":685,"props":3231,"children":3232},{"style":719},[3233],{"type":47,"value":755},{"type":41,"tag":685,"props":3235,"children":3236},{"style":708},[3237],{"type":47,"value":760},{"type":41,"tag":685,"props":3239,"children":3240},{"style":719},[3241],{"type":47,"value":765},{"type":41,"tag":685,"props":3243,"children":3244},{"style":702},[3245],{"type":47,"value":770},{"type":41,"tag":685,"props":3247,"children":3248},{"style":719},[3249],{"type":47,"value":722},{"type":41,"tag":685,"props":3251,"children":3252},{"style":725},[3253],{"type":47,"value":779},{"type":41,"tag":685,"props":3255,"children":3256},{"style":719},[3257],{"type":47,"value":732},{"type":41,"tag":685,"props":3259,"children":3260},{"style":719},[3261],{"type":47,"value":737},{"type":41,"tag":685,"props":3263,"children":3264},{"class":687,"line":790},[3265,3269,3273,3277,3281,3285,3289,3293,3297,3301,3305,3309,3313,3317],{"type":41,"tag":685,"props":3266,"children":3267},{"style":702},[3268],{"type":47,"value":705},{"type":41,"tag":685,"props":3270,"children":3271},{"style":708},[3272],{"type":47,"value":800},{"type":41,"tag":685,"props":3274,"children":3275},{"style":702},[3276],{"type":47,"value":716},{"type":41,"tag":685,"props":3278,"children":3279},{"style":719},[3280],{"type":47,"value":722},{"type":41,"tag":685,"props":3282,"children":3283},{"style":725},[3284],{"type":47,"value":813},{"type":41,"tag":685,"props":3286,"children":3287},{"style":719},[3288],{"type":47,"value":732},{"type":41,"tag":685,"props":3290,"children":3291},{"style":702},[3292],{"type":47,"value":822},{"type":41,"tag":685,"props":3294,"children":3295},{"style":719},[3296],{"type":47,"value":755},{"type":41,"tag":685,"props":3298,"children":3299},{"style":829},[3300],{"type":47,"value":750},{"type":41,"tag":685,"props":3302,"children":3303},{"style":719},[3304],{"type":47,"value":836},{"type":41,"tag":685,"props":3306,"children":3307},{"style":719},[3308],{"type":47,"value":722},{"type":41,"tag":685,"props":3310,"children":3311},{"style":725},[3312],{"type":47,"value":845},{"type":41,"tag":685,"props":3314,"children":3315},{"style":719},[3316],{"type":47,"value":732},{"type":41,"tag":685,"props":3318,"children":3319},{"style":719},[3320],{"type":47,"value":854},{"type":41,"tag":685,"props":3322,"children":3323},{"class":687,"line":857},[3324],{"type":41,"tag":685,"props":3325,"children":3326},{"emptyLinePlaceholder":861},[3327],{"type":47,"value":864},{"type":41,"tag":685,"props":3329,"children":3330},{"class":687,"line":867},[3331,3335,3339,3343,3347,3351,3355,3359,3363,3367],{"type":41,"tag":685,"props":3332,"children":3333},{"style":702},[3334],{"type":47,"value":873},{"type":41,"tag":685,"props":3336,"children":3337},{"style":876},[3338],{"type":47,"value":879},{"type":41,"tag":685,"props":3340,"children":3341},{"style":708},[3342],{"type":47,"value":884},{"type":41,"tag":685,"props":3344,"children":3345},{"style":719},[3346],{"type":47,"value":889},{"type":41,"tag":685,"props":3348,"children":3349},{"style":892},[3350],{"type":47,"value":895},{"type":41,"tag":685,"props":3352,"children":3353},{"style":719},[3354],{"type":47,"value":900},{"type":41,"tag":685,"props":3356,"children":3357},{"style":903},[3358],{"type":47,"value":365},{"type":41,"tag":685,"props":3360,"children":3361},{"style":719},[3362],{"type":47,"value":910},{"type":41,"tag":685,"props":3364,"children":3365},{"style":708},[3366],{"type":47,"value":915},{"type":41,"tag":685,"props":3368,"children":3369},{"style":719},[3370],{"type":47,"value":920},{"type":41,"tag":685,"props":3372,"children":3373},{"class":687,"line":923},[3374,3378],{"type":41,"tag":685,"props":3375,"children":3376},{"style":708},[3377],{"type":47,"value":929},{"type":41,"tag":685,"props":3379,"children":3380},{"style":719},[3381],{"type":47,"value":934},{"type":41,"tag":685,"props":3383,"children":3384},{"class":687,"line":937},[3385,3389,3393,3397,3401,3405,3409,3413,3417,3421],{"type":41,"tag":685,"props":3386,"children":3387},{"style":829},[3388],{"type":47,"value":943},{"type":41,"tag":685,"props":3390,"children":3391},{"style":719},[3392],{"type":47,"value":836},{"type":41,"tag":685,"props":3394,"children":3395},{"style":708},[3396],{"type":47,"value":952},{"type":41,"tag":685,"props":3398,"children":3399},{"style":719},[3400],{"type":47,"value":184},{"type":41,"tag":685,"props":3402,"children":3403},{"style":708},[3404],{"type":47,"value":961},{"type":41,"tag":685,"props":3406,"children":3407},{"style":719},[3408],{"type":47,"value":732},{"type":41,"tag":685,"props":3410,"children":3411},{"style":725},[3412],{"type":47,"value":561},{"type":41,"tag":685,"props":3414,"children":3415},{"style":719},[3416],{"type":47,"value":732},{"type":41,"tag":685,"props":3418,"children":3419},{"style":708},[3420],{"type":47,"value":978},{"type":41,"tag":685,"props":3422,"children":3423},{"style":719},[3424],{"type":47,"value":934},{"type":41,"tag":685,"props":3426,"children":3427},{"class":687,"line":985},[3428,3433,3437],{"type":41,"tag":685,"props":3429,"children":3430},{"style":829},[3431],{"type":47,"value":3432},"  middleware",{"type":41,"tag":685,"props":3434,"children":3435},{"style":719},[3436],{"type":47,"value":836},{"type":41,"tag":685,"props":3438,"children":3439},{"style":708},[3440],{"type":47,"value":3441}," [\n",{"type":41,"tag":685,"props":3443,"children":3444},{"class":687,"line":2062},[3445,3450,3454],{"type":41,"tag":685,"props":3446,"children":3447},{"style":892},[3448],{"type":47,"value":3449},"    createTelemetryMiddleware",{"type":41,"tag":685,"props":3451,"children":3452},{"style":708},[3453],{"type":47,"value":915},{"type":41,"tag":685,"props":3455,"children":3456},{"style":719},[3457],{"type":47,"value":920},{"type":41,"tag":685,"props":3459,"children":3461},{"class":687,"line":3460},11,[3462,3467,3471,3475,3480,3484,3488],{"type":41,"tag":685,"props":3463,"children":3464},{"style":892},[3465],{"type":47,"value":3466},"      onEvent",{"type":41,"tag":685,"props":3468,"children":3469},{"style":719},[3470],{"type":47,"value":836},{"type":41,"tag":685,"props":3472,"children":3473},{"style":719},[3474],{"type":47,"value":2183},{"type":41,"tag":685,"props":3476,"children":3477},{"style":2186},[3478],{"type":47,"value":3479},"event",{"type":41,"tag":685,"props":3481,"children":3482},{"style":719},[3483],{"type":47,"value":996},{"type":41,"tag":685,"props":3485,"children":3486},{"style":876},[3487],{"type":47,"value":2207},{"type":41,"tag":685,"props":3489,"children":3490},{"style":719},[3491],{"type":47,"value":2212},{"type":41,"tag":685,"props":3493,"children":3495},{"class":687,"line":3494},12,[3496],{"type":41,"tag":685,"props":3497,"children":3498},{"style":692},[3499],{"type":47,"value":3500},"        \u002F\u002F forward to your collector, log, etc.\n",{"type":41,"tag":685,"props":3502,"children":3504},{"class":687,"line":3503},13,[3505],{"type":41,"tag":685,"props":3506,"children":3507},{"style":719},[3508],{"type":47,"value":3509},"      },\n",{"type":41,"tag":685,"props":3511,"children":3513},{"class":687,"line":3512},14,[3514,3519,3523],{"type":41,"tag":685,"props":3515,"children":3516},{"style":719},[3517],{"type":47,"value":3518},"    }",{"type":41,"tag":685,"props":3520,"children":3521},{"style":708},[3522],{"type":47,"value":996},{"type":41,"tag":685,"props":3524,"children":3525},{"style":719},[3526],{"type":47,"value":934},{"type":41,"tag":685,"props":3528,"children":3529},{"class":687,"line":27},[3530,3535],{"type":41,"tag":685,"props":3531,"children":3532},{"style":708},[3533],{"type":47,"value":3534},"  ]",{"type":41,"tag":685,"props":3536,"children":3537},{"style":719},[3538],{"type":47,"value":934},{"type":41,"tag":685,"props":3540,"children":3542},{"class":687,"line":3541},16,[3543,3547,3551],{"type":41,"tag":685,"props":3544,"children":3545},{"style":719},[3546],{"type":47,"value":991},{"type":41,"tag":685,"props":3548,"children":3549},{"style":708},[3550],{"type":47,"value":996},{"type":41,"tag":685,"props":3552,"children":3553},{"style":719},[3554],{"type":47,"value":737},{"type":41,"tag":63,"props":3556,"children":3557},{},[3558,3564,3566,3571,3573,3579,3581,3587],{"type":41,"tag":50,"props":3559,"children":3561},{"className":3560},[],[3562],{"type":47,"value":3563},"createTelemetryMiddleware",{"type":47,"value":3565}," is shipped as a separate user-installable package (",{"type":41,"tag":50,"props":3567,"children":3569},{"className":3568},[],[3570],{"type":47,"value":3210},{"type":47,"value":3572},"), not as a ",{"type":41,"tag":50,"props":3574,"children":3576},{"className":3575},[],[3577],{"type":47,"value":3578},"\u002Fmiddleware",{"type":47,"value":3580}," subpath of the postgres façade. Install it directly. Run ",{"type":41,"tag":50,"props":3582,"children":3584},{"className":3583},[],[3585],{"type":47,"value":3586},"pnpm ls @prisma-next\u002Fmiddleware-telemetry",{"type":47,"value":3588}," to confirm it's on the lockfile.",{"type":41,"tag":92,"props":3590,"children":3592},{"id":3591},"workflow-lints-and-budgets-middleware",[3593],{"type":47,"value":3594},"Workflow — Lints and budgets middleware",{"type":41,"tag":63,"props":3596,"children":3597},{},[3598,3600,3606,3608,3614,3615,3621,3622,3628],{"type":47,"value":3599},"The concept: lints catch authoring mistakes that survive type-check (e.g. ",{"type":41,"tag":50,"props":3601,"children":3603},{"className":3602},[],[3604],{"type":47,"value":3605},"DELETE",{"type":47,"value":3607}," without a ",{"type":41,"tag":50,"props":3609,"children":3611},{"className":3610},[],[3612],{"type":47,"value":3613},"WHERE",{"type":47,"value":163},{"type":41,"tag":50,"props":3616,"children":3618},{"className":3617},[],[3619],{"type":47,"value":3620},"SELECT",{"type":47,"value":3607},{"type":41,"tag":50,"props":3623,"children":3625},{"className":3624},[],[3626],{"type":47,"value":3627},"LIMIT",{"type":47,"value":3629}," on a large table); budgets enforce row-count and latency ceilings at runtime. Both surface findings through the structured-error envelope so an agent can branch on the code.",{"type":41,"tag":63,"props":3631,"children":3632},{},[3633,3635,3641,3643,3647,3649,3653,3655,3661],{"type":47,"value":3634},"These ship in the underlying SQL runtime package (",{"type":41,"tag":50,"props":3636,"children":3638},{"className":3637},[],[3639],{"type":47,"value":3640},"@prisma-next\u002Fsql-runtime",{"type":47,"value":3642},") and are ",{"type":41,"tag":178,"props":3644,"children":3645},{},[3646],{"type":47,"value":3074},{"type":47,"value":3648}," yet re-exported from the postgres façade — see ",{"type":41,"tag":178,"props":3650,"children":3651},{},[3652],{"type":47,"value":1194},{"type":47,"value":3654},". The example apps under ",{"type":41,"tag":50,"props":3656,"children":3658},{"className":3657},[],[3659],{"type":47,"value":3660},"examples\u002Fprisma-next-demo\u002Fsrc\u002Fprisma\u002Fdb.ts",{"type":47,"value":3662}," show the canonical import.",{"type":41,"tag":674,"props":3664,"children":3666},{"className":676,"code":3665,"language":678,"meta":679,"style":679},"import postgres from '@prisma-next\u002Fpostgres\u002Fruntime';\nimport { budgets, lints } from '@prisma-next\u002Fsql-runtime';\nimport type { Contract } from '.\u002Fcontract.d';\nimport contractJson from '.\u002Fcontract.json' with { type: 'json' };\n\nexport const db = postgres\u003CContract>({\n  contractJson,\n  url: process.env['DATABASE_URL'],\n  middleware: [\n    lints({\n      severities: {\n        selectStar: 'warn',\n        noLimit: 'error',\n        deleteWithoutWhere: 'error',\n        updateWithoutWhere: 'error',\n        readOnlyMutation: 'error',\n      },\n    }),\n    budgets({\n      maxRows: 10_000,\n      defaultTableRows: 10_000,\n      tableRows: { user: 10_000, post: 50_000 },\n      maxLatencyMs: 1_000,\n      severities: { rowCount: 'error', latency: 'warn' },\n    }),\n  ],\n});\n",[3667],{"type":41,"tag":50,"props":3668,"children":3669},{"__ignoreMap":679},[3670,3701,3750,3793,3852,3859,3902,3913,3956,3971,3987,4003,4032,4061,4089,4117,4145,4153,4169,4186,4209,4230,4283,4305,4371,4387,4399],{"type":41,"tag":685,"props":3671,"children":3672},{"class":687,"line":688},[3673,3677,3681,3685,3689,3693,3697],{"type":41,"tag":685,"props":3674,"children":3675},{"style":702},[3676],{"type":47,"value":705},{"type":41,"tag":685,"props":3678,"children":3679},{"style":708},[3680],{"type":47,"value":711},{"type":41,"tag":685,"props":3682,"children":3683},{"style":702},[3684],{"type":47,"value":716},{"type":41,"tag":685,"props":3686,"children":3687},{"style":719},[3688],{"type":47,"value":722},{"type":41,"tag":685,"props":3690,"children":3691},{"style":725},[3692],{"type":47,"value":334},{"type":41,"tag":685,"props":3694,"children":3695},{"style":719},[3696],{"type":47,"value":732},{"type":41,"tag":685,"props":3698,"children":3699},{"style":719},[3700],{"type":47,"value":737},{"type":41,"tag":685,"props":3702,"children":3703},{"class":687,"line":698},[3704,3708,3712,3717,3721,3726,3730,3734,3738,3742,3746],{"type":41,"tag":685,"props":3705,"children":3706},{"style":702},[3707],{"type":47,"value":705},{"type":41,"tag":685,"props":3709,"children":3710},{"style":719},[3711],{"type":47,"value":755},{"type":41,"tag":685,"props":3713,"children":3714},{"style":708},[3715],{"type":47,"value":3716}," budgets",{"type":41,"tag":685,"props":3718,"children":3719},{"style":719},[3720],{"type":47,"value":1509},{"type":41,"tag":685,"props":3722,"children":3723},{"style":708},[3724],{"type":47,"value":3725}," lints",{"type":41,"tag":685,"props":3727,"children":3728},{"style":719},[3729],{"type":47,"value":765},{"type":41,"tag":685,"props":3731,"children":3732},{"style":702},[3733],{"type":47,"value":770},{"type":41,"tag":685,"props":3735,"children":3736},{"style":719},[3737],{"type":47,"value":722},{"type":41,"tag":685,"props":3739,"children":3740},{"style":725},[3741],{"type":47,"value":3640},{"type":41,"tag":685,"props":3743,"children":3744},{"style":719},[3745],{"type":47,"value":732},{"type":41,"tag":685,"props":3747,"children":3748},{"style":719},[3749],{"type":47,"value":737},{"type":41,"tag":685,"props":3751,"children":3752},{"class":687,"line":740},[3753,3757,3761,3765,3769,3773,3777,3781,3785,3789],{"type":41,"tag":685,"props":3754,"children":3755},{"style":702},[3756],{"type":47,"value":705},{"type":41,"tag":685,"props":3758,"children":3759},{"style":702},[3760],{"type":47,"value":750},{"type":41,"tag":685,"props":3762,"children":3763},{"style":719},[3764],{"type":47,"value":755},{"type":41,"tag":685,"props":3766,"children":3767},{"style":708},[3768],{"type":47,"value":760},{"type":41,"tag":685,"props":3770,"children":3771},{"style":719},[3772],{"type":47,"value":765},{"type":41,"tag":685,"props":3774,"children":3775},{"style":702},[3776],{"type":47,"value":770},{"type":41,"tag":685,"props":3778,"children":3779},{"style":719},[3780],{"type":47,"value":722},{"type":41,"tag":685,"props":3782,"children":3783},{"style":725},[3784],{"type":47,"value":779},{"type":41,"tag":685,"props":3786,"children":3787},{"style":719},[3788],{"type":47,"value":732},{"type":41,"tag":685,"props":3790,"children":3791},{"style":719},[3792],{"type":47,"value":737},{"type":41,"tag":685,"props":3794,"children":3795},{"class":687,"line":790},[3796,3800,3804,3808,3812,3816,3820,3824,3828,3832,3836,3840,3844,3848],{"type":41,"tag":685,"props":3797,"children":3798},{"style":702},[3799],{"type":47,"value":705},{"type":41,"tag":685,"props":3801,"children":3802},{"style":708},[3803],{"type":47,"value":800},{"type":41,"tag":685,"props":3805,"children":3806},{"style":702},[3807],{"type":47,"value":716},{"type":41,"tag":685,"props":3809,"children":3810},{"style":719},[3811],{"type":47,"value":722},{"type":41,"tag":685,"props":3813,"children":3814},{"style":725},[3815],{"type":47,"value":813},{"type":41,"tag":685,"props":3817,"children":3818},{"style":719},[3819],{"type":47,"value":732},{"type":41,"tag":685,"props":3821,"children":3822},{"style":702},[3823],{"type":47,"value":822},{"type":41,"tag":685,"props":3825,"children":3826},{"style":719},[3827],{"type":47,"value":755},{"type":41,"tag":685,"props":3829,"children":3830},{"style":829},[3831],{"type":47,"value":750},{"type":41,"tag":685,"props":3833,"children":3834},{"style":719},[3835],{"type":47,"value":836},{"type":41,"tag":685,"props":3837,"children":3838},{"style":719},[3839],{"type":47,"value":722},{"type":41,"tag":685,"props":3841,"children":3842},{"style":725},[3843],{"type":47,"value":845},{"type":41,"tag":685,"props":3845,"children":3846},{"style":719},[3847],{"type":47,"value":732},{"type":41,"tag":685,"props":3849,"children":3850},{"style":719},[3851],{"type":47,"value":854},{"type":41,"tag":685,"props":3853,"children":3854},{"class":687,"line":857},[3855],{"type":41,"tag":685,"props":3856,"children":3857},{"emptyLinePlaceholder":861},[3858],{"type":47,"value":864},{"type":41,"tag":685,"props":3860,"children":3861},{"class":687,"line":867},[3862,3866,3870,3874,3878,3882,3886,3890,3894,3898],{"type":41,"tag":685,"props":3863,"children":3864},{"style":702},[3865],{"type":47,"value":873},{"type":41,"tag":685,"props":3867,"children":3868},{"style":876},[3869],{"type":47,"value":879},{"type":41,"tag":685,"props":3871,"children":3872},{"style":708},[3873],{"type":47,"value":884},{"type":41,"tag":685,"props":3875,"children":3876},{"style":719},[3877],{"type":47,"value":889},{"type":41,"tag":685,"props":3879,"children":3880},{"style":892},[3881],{"type":47,"value":895},{"type":41,"tag":685,"props":3883,"children":3884},{"style":719},[3885],{"type":47,"value":900},{"type":41,"tag":685,"props":3887,"children":3888},{"style":903},[3889],{"type":47,"value":365},{"type":41,"tag":685,"props":3891,"children":3892},{"style":719},[3893],{"type":47,"value":910},{"type":41,"tag":685,"props":3895,"children":3896},{"style":708},[3897],{"type":47,"value":915},{"type":41,"tag":685,"props":3899,"children":3900},{"style":719},[3901],{"type":47,"value":920},{"type":41,"tag":685,"props":3903,"children":3904},{"class":687,"line":923},[3905,3909],{"type":41,"tag":685,"props":3906,"children":3907},{"style":708},[3908],{"type":47,"value":929},{"type":41,"tag":685,"props":3910,"children":3911},{"style":719},[3912],{"type":47,"value":934},{"type":41,"tag":685,"props":3914,"children":3915},{"class":687,"line":937},[3916,3920,3924,3928,3932,3936,3940,3944,3948,3952],{"type":41,"tag":685,"props":3917,"children":3918},{"style":829},[3919],{"type":47,"value":943},{"type":41,"tag":685,"props":3921,"children":3922},{"style":719},[3923],{"type":47,"value":836},{"type":41,"tag":685,"props":3925,"children":3926},{"style":708},[3927],{"type":47,"value":952},{"type":41,"tag":685,"props":3929,"children":3930},{"style":719},[3931],{"type":47,"value":184},{"type":41,"tag":685,"props":3933,"children":3934},{"style":708},[3935],{"type":47,"value":961},{"type":41,"tag":685,"props":3937,"children":3938},{"style":719},[3939],{"type":47,"value":732},{"type":41,"tag":685,"props":3941,"children":3942},{"style":725},[3943],{"type":47,"value":561},{"type":41,"tag":685,"props":3945,"children":3946},{"style":719},[3947],{"type":47,"value":732},{"type":41,"tag":685,"props":3949,"children":3950},{"style":708},[3951],{"type":47,"value":978},{"type":41,"tag":685,"props":3953,"children":3954},{"style":719},[3955],{"type":47,"value":934},{"type":41,"tag":685,"props":3957,"children":3958},{"class":687,"line":985},[3959,3963,3967],{"type":41,"tag":685,"props":3960,"children":3961},{"style":829},[3962],{"type":47,"value":3432},{"type":41,"tag":685,"props":3964,"children":3965},{"style":719},[3966],{"type":47,"value":836},{"type":41,"tag":685,"props":3968,"children":3969},{"style":708},[3970],{"type":47,"value":3441},{"type":41,"tag":685,"props":3972,"children":3973},{"class":687,"line":2062},[3974,3979,3983],{"type":41,"tag":685,"props":3975,"children":3976},{"style":892},[3977],{"type":47,"value":3978},"    lints",{"type":41,"tag":685,"props":3980,"children":3981},{"style":708},[3982],{"type":47,"value":915},{"type":41,"tag":685,"props":3984,"children":3985},{"style":719},[3986],{"type":47,"value":920},{"type":41,"tag":685,"props":3988,"children":3989},{"class":687,"line":3460},[3990,3995,3999],{"type":41,"tag":685,"props":3991,"children":3992},{"style":829},[3993],{"type":47,"value":3994},"      severities",{"type":41,"tag":685,"props":3996,"children":3997},{"style":719},[3998],{"type":47,"value":836},{"type":41,"tag":685,"props":4000,"children":4001},{"style":719},[4002],{"type":47,"value":2212},{"type":41,"tag":685,"props":4004,"children":4005},{"class":687,"line":3494},[4006,4011,4015,4019,4024,4028],{"type":41,"tag":685,"props":4007,"children":4008},{"style":829},[4009],{"type":47,"value":4010},"        selectStar",{"type":41,"tag":685,"props":4012,"children":4013},{"style":719},[4014],{"type":47,"value":836},{"type":41,"tag":685,"props":4016,"children":4017},{"style":719},[4018],{"type":47,"value":722},{"type":41,"tag":685,"props":4020,"children":4021},{"style":725},[4022],{"type":47,"value":4023},"warn",{"type":41,"tag":685,"props":4025,"children":4026},{"style":719},[4027],{"type":47,"value":732},{"type":41,"tag":685,"props":4029,"children":4030},{"style":719},[4031],{"type":47,"value":934},{"type":41,"tag":685,"props":4033,"children":4034},{"class":687,"line":3503},[4035,4040,4044,4048,4053,4057],{"type":41,"tag":685,"props":4036,"children":4037},{"style":829},[4038],{"type":47,"value":4039},"        noLimit",{"type":41,"tag":685,"props":4041,"children":4042},{"style":719},[4043],{"type":47,"value":836},{"type":41,"tag":685,"props":4045,"children":4046},{"style":719},[4047],{"type":47,"value":722},{"type":41,"tag":685,"props":4049,"children":4050},{"style":725},[4051],{"type":47,"value":4052},"error",{"type":41,"tag":685,"props":4054,"children":4055},{"style":719},[4056],{"type":47,"value":732},{"type":41,"tag":685,"props":4058,"children":4059},{"style":719},[4060],{"type":47,"value":934},{"type":41,"tag":685,"props":4062,"children":4063},{"class":687,"line":3512},[4064,4069,4073,4077,4081,4085],{"type":41,"tag":685,"props":4065,"children":4066},{"style":829},[4067],{"type":47,"value":4068},"        deleteWithoutWhere",{"type":41,"tag":685,"props":4070,"children":4071},{"style":719},[4072],{"type":47,"value":836},{"type":41,"tag":685,"props":4074,"children":4075},{"style":719},[4076],{"type":47,"value":722},{"type":41,"tag":685,"props":4078,"children":4079},{"style":725},[4080],{"type":47,"value":4052},{"type":41,"tag":685,"props":4082,"children":4083},{"style":719},[4084],{"type":47,"value":732},{"type":41,"tag":685,"props":4086,"children":4087},{"style":719},[4088],{"type":47,"value":934},{"type":41,"tag":685,"props":4090,"children":4091},{"class":687,"line":27},[4092,4097,4101,4105,4109,4113],{"type":41,"tag":685,"props":4093,"children":4094},{"style":829},[4095],{"type":47,"value":4096},"        updateWithoutWhere",{"type":41,"tag":685,"props":4098,"children":4099},{"style":719},[4100],{"type":47,"value":836},{"type":41,"tag":685,"props":4102,"children":4103},{"style":719},[4104],{"type":47,"value":722},{"type":41,"tag":685,"props":4106,"children":4107},{"style":725},[4108],{"type":47,"value":4052},{"type":41,"tag":685,"props":4110,"children":4111},{"style":719},[4112],{"type":47,"value":732},{"type":41,"tag":685,"props":4114,"children":4115},{"style":719},[4116],{"type":47,"value":934},{"type":41,"tag":685,"props":4118,"children":4119},{"class":687,"line":3541},[4120,4125,4129,4133,4137,4141],{"type":41,"tag":685,"props":4121,"children":4122},{"style":829},[4123],{"type":47,"value":4124},"        readOnlyMutation",{"type":41,"tag":685,"props":4126,"children":4127},{"style":719},[4128],{"type":47,"value":836},{"type":41,"tag":685,"props":4130,"children":4131},{"style":719},[4132],{"type":47,"value":722},{"type":41,"tag":685,"props":4134,"children":4135},{"style":725},[4136],{"type":47,"value":4052},{"type":41,"tag":685,"props":4138,"children":4139},{"style":719},[4140],{"type":47,"value":732},{"type":41,"tag":685,"props":4142,"children":4143},{"style":719},[4144],{"type":47,"value":934},{"type":41,"tag":685,"props":4146,"children":4148},{"class":687,"line":4147},17,[4149],{"type":41,"tag":685,"props":4150,"children":4151},{"style":719},[4152],{"type":47,"value":3509},{"type":41,"tag":685,"props":4154,"children":4156},{"class":687,"line":4155},18,[4157,4161,4165],{"type":41,"tag":685,"props":4158,"children":4159},{"style":719},[4160],{"type":47,"value":3518},{"type":41,"tag":685,"props":4162,"children":4163},{"style":708},[4164],{"type":47,"value":996},{"type":41,"tag":685,"props":4166,"children":4167},{"style":719},[4168],{"type":47,"value":934},{"type":41,"tag":685,"props":4170,"children":4172},{"class":687,"line":4171},19,[4173,4178,4182],{"type":41,"tag":685,"props":4174,"children":4175},{"style":892},[4176],{"type":47,"value":4177},"    budgets",{"type":41,"tag":685,"props":4179,"children":4180},{"style":708},[4181],{"type":47,"value":915},{"type":41,"tag":685,"props":4183,"children":4184},{"style":719},[4185],{"type":47,"value":920},{"type":41,"tag":685,"props":4187,"children":4189},{"class":687,"line":4188},20,[4190,4195,4199,4205],{"type":41,"tag":685,"props":4191,"children":4192},{"style":829},[4193],{"type":47,"value":4194},"      maxRows",{"type":41,"tag":685,"props":4196,"children":4197},{"style":719},[4198],{"type":47,"value":836},{"type":41,"tag":685,"props":4200,"children":4202},{"style":4201},"--shiki-light:#F76D47;--shiki-default:#F78C6C;--shiki-dark:#F78C6C",[4203],{"type":47,"value":4204}," 10_000",{"type":41,"tag":685,"props":4206,"children":4207},{"style":719},[4208],{"type":47,"value":934},{"type":41,"tag":685,"props":4210,"children":4212},{"class":687,"line":4211},21,[4213,4218,4222,4226],{"type":41,"tag":685,"props":4214,"children":4215},{"style":829},[4216],{"type":47,"value":4217},"      defaultTableRows",{"type":41,"tag":685,"props":4219,"children":4220},{"style":719},[4221],{"type":47,"value":836},{"type":41,"tag":685,"props":4223,"children":4224},{"style":4201},[4225],{"type":47,"value":4204},{"type":41,"tag":685,"props":4227,"children":4228},{"style":719},[4229],{"type":47,"value":934},{"type":41,"tag":685,"props":4231,"children":4233},{"class":687,"line":4232},22,[4234,4239,4243,4247,4252,4256,4260,4264,4269,4273,4278],{"type":41,"tag":685,"props":4235,"children":4236},{"style":829},[4237],{"type":47,"value":4238},"      tableRows",{"type":41,"tag":685,"props":4240,"children":4241},{"style":719},[4242],{"type":47,"value":836},{"type":41,"tag":685,"props":4244,"children":4245},{"style":719},[4246],{"type":47,"value":755},{"type":41,"tag":685,"props":4248,"children":4249},{"style":829},[4250],{"type":47,"value":4251}," user",{"type":41,"tag":685,"props":4253,"children":4254},{"style":719},[4255],{"type":47,"value":836},{"type":41,"tag":685,"props":4257,"children":4258},{"style":4201},[4259],{"type":47,"value":4204},{"type":41,"tag":685,"props":4261,"children":4262},{"style":719},[4263],{"type":47,"value":1509},{"type":41,"tag":685,"props":4265,"children":4266},{"style":829},[4267],{"type":47,"value":4268}," post",{"type":41,"tag":685,"props":4270,"children":4271},{"style":719},[4272],{"type":47,"value":836},{"type":41,"tag":685,"props":4274,"children":4275},{"style":4201},[4276],{"type":47,"value":4277}," 50_000",{"type":41,"tag":685,"props":4279,"children":4280},{"style":719},[4281],{"type":47,"value":4282}," },\n",{"type":41,"tag":685,"props":4284,"children":4286},{"class":687,"line":4285},23,[4287,4292,4296,4301],{"type":41,"tag":685,"props":4288,"children":4289},{"style":829},[4290],{"type":47,"value":4291},"      maxLatencyMs",{"type":41,"tag":685,"props":4293,"children":4294},{"style":719},[4295],{"type":47,"value":836},{"type":41,"tag":685,"props":4297,"children":4298},{"style":4201},[4299],{"type":47,"value":4300}," 1_000",{"type":41,"tag":685,"props":4302,"children":4303},{"style":719},[4304],{"type":47,"value":934},{"type":41,"tag":685,"props":4306,"children":4308},{"class":687,"line":4307},24,[4309,4313,4317,4321,4326,4330,4334,4338,4342,4346,4351,4355,4359,4363,4367],{"type":41,"tag":685,"props":4310,"children":4311},{"style":829},[4312],{"type":47,"value":3994},{"type":41,"tag":685,"props":4314,"children":4315},{"style":719},[4316],{"type":47,"value":836},{"type":41,"tag":685,"props":4318,"children":4319},{"style":719},[4320],{"type":47,"value":755},{"type":41,"tag":685,"props":4322,"children":4323},{"style":829},[4324],{"type":47,"value":4325}," rowCount",{"type":41,"tag":685,"props":4327,"children":4328},{"style":719},[4329],{"type":47,"value":836},{"type":41,"tag":685,"props":4331,"children":4332},{"style":719},[4333],{"type":47,"value":722},{"type":41,"tag":685,"props":4335,"children":4336},{"style":725},[4337],{"type":47,"value":4052},{"type":41,"tag":685,"props":4339,"children":4340},{"style":719},[4341],{"type":47,"value":732},{"type":41,"tag":685,"props":4343,"children":4344},{"style":719},[4345],{"type":47,"value":1509},{"type":41,"tag":685,"props":4347,"children":4348},{"style":829},[4349],{"type":47,"value":4350}," latency",{"type":41,"tag":685,"props":4352,"children":4353},{"style":719},[4354],{"type":47,"value":836},{"type":41,"tag":685,"props":4356,"children":4357},{"style":719},[4358],{"type":47,"value":722},{"type":41,"tag":685,"props":4360,"children":4361},{"style":725},[4362],{"type":47,"value":4023},{"type":41,"tag":685,"props":4364,"children":4365},{"style":719},[4366],{"type":47,"value":732},{"type":41,"tag":685,"props":4368,"children":4369},{"style":719},[4370],{"type":47,"value":4282},{"type":41,"tag":685,"props":4372,"children":4374},{"class":687,"line":4373},25,[4375,4379,4383],{"type":41,"tag":685,"props":4376,"children":4377},{"style":719},[4378],{"type":47,"value":3518},{"type":41,"tag":685,"props":4380,"children":4381},{"style":708},[4382],{"type":47,"value":996},{"type":41,"tag":685,"props":4384,"children":4385},{"style":719},[4386],{"type":47,"value":934},{"type":41,"tag":685,"props":4388,"children":4390},{"class":687,"line":4389},26,[4391,4395],{"type":41,"tag":685,"props":4392,"children":4393},{"style":708},[4394],{"type":47,"value":3534},{"type":41,"tag":685,"props":4396,"children":4397},{"style":719},[4398],{"type":47,"value":934},{"type":41,"tag":685,"props":4400,"children":4402},{"class":687,"line":4401},27,[4403,4407,4411],{"type":41,"tag":685,"props":4404,"children":4405},{"style":719},[4406],{"type":47,"value":991},{"type":41,"tag":685,"props":4408,"children":4409},{"style":708},[4410],{"type":47,"value":996},{"type":41,"tag":685,"props":4412,"children":4413},{"style":719},[4414],{"type":47,"value":737},{"type":41,"tag":63,"props":4416,"children":4417},{},[4418,4420,4426,4427,4433,4435,4441,4443,4449,4450,4456,4457,4463,4464,4470,4471,4477,4479,4485,4486,4492],{"type":47,"value":4419},"For the full option surface, read the source: ",{"type":41,"tag":50,"props":4421,"children":4423},{"className":4422},[],[4424],{"type":47,"value":4425},"packages\u002F2-sql\u002F5-runtime\u002Fsrc\u002Fmiddleware\u002Flints.ts",{"type":47,"value":2790},{"type":41,"tag":50,"props":4428,"children":4430},{"className":4429},[],[4431],{"type":47,"value":4432},"...\u002Fbudgets.ts",{"type":47,"value":4434},". The ",{"type":41,"tag":50,"props":4436,"children":4438},{"className":4437},[],[4439],{"type":47,"value":4440},"severities",{"type":47,"value":4442}," keys (",{"type":41,"tag":50,"props":4444,"children":4446},{"className":4445},[],[4447],{"type":47,"value":4448},"selectStar",{"type":47,"value":163},{"type":41,"tag":50,"props":4451,"children":4453},{"className":4452},[],[4454],{"type":47,"value":4455},"noLimit",{"type":47,"value":163},{"type":41,"tag":50,"props":4458,"children":4460},{"className":4459},[],[4461],{"type":47,"value":4462},"deleteWithoutWhere",{"type":47,"value":163},{"type":41,"tag":50,"props":4465,"children":4467},{"className":4466},[],[4468],{"type":47,"value":4469},"updateWithoutWhere",{"type":47,"value":163},{"type":41,"tag":50,"props":4472,"children":4474},{"className":4473},[],[4475],{"type":47,"value":4476},"readOnlyMutation",{"type":47,"value":4478}," for lints; ",{"type":41,"tag":50,"props":4480,"children":4482},{"className":4481},[],[4483],{"type":47,"value":4484},"rowCount",{"type":47,"value":163},{"type":41,"tag":50,"props":4487,"children":4489},{"className":4488},[],[4490],{"type":47,"value":4491},"latency",{"type":47,"value":4493}," for budgets) are the source of truth; do not extrapolate to a key that ripgrep can't find.",{"type":41,"tag":92,"props":4495,"children":4497},{"id":4496},"workflow-compose-multiple-middleware",[4498],{"type":47,"value":4499},"Workflow — Compose multiple middleware",{"type":41,"tag":674,"props":4501,"children":4503},{"className":676,"code":4502,"language":678,"meta":679,"style":679},"middleware: [\n  createTelemetryMiddleware({ onEvent }),  \u002F\u002F outermost — sees all sub-failures as inner errors\n  lints({ severities: { noLimit: 'error' } }),\n  budgets({ maxLatencyMs: 5_000 }),         \u002F\u002F innermost — runs closest to the driver\n],\n",[4504],{"type":41,"tag":50,"props":4505,"children":4506},{"__ignoreMap":679},[4507,4523,4561,4627,4674],{"type":41,"tag":685,"props":4508,"children":4509},{"class":687,"line":688},[4510,4515,4519],{"type":41,"tag":685,"props":4511,"children":4512},{"style":903},[4513],{"type":47,"value":4514},"middleware",{"type":41,"tag":685,"props":4516,"children":4517},{"style":719},[4518],{"type":47,"value":836},{"type":41,"tag":685,"props":4520,"children":4521},{"style":708},[4522],{"type":47,"value":3441},{"type":41,"tag":685,"props":4524,"children":4525},{"class":687,"line":698},[4526,4531,4535,4539,4544,4548,4552,4556],{"type":41,"tag":685,"props":4527,"children":4528},{"style":892},[4529],{"type":47,"value":4530},"  createTelemetryMiddleware",{"type":41,"tag":685,"props":4532,"children":4533},{"style":708},[4534],{"type":47,"value":915},{"type":41,"tag":685,"props":4536,"children":4537},{"style":719},[4538],{"type":47,"value":1482},{"type":41,"tag":685,"props":4540,"children":4541},{"style":708},[4542],{"type":47,"value":4543}," onEvent ",{"type":41,"tag":685,"props":4545,"children":4546},{"style":719},[4547],{"type":47,"value":991},{"type":41,"tag":685,"props":4549,"children":4550},{"style":708},[4551],{"type":47,"value":996},{"type":41,"tag":685,"props":4553,"children":4554},{"style":719},[4555],{"type":47,"value":1509},{"type":41,"tag":685,"props":4557,"children":4558},{"style":692},[4559],{"type":47,"value":4560},"  \u002F\u002F outermost — sees all sub-failures as inner errors\n",{"type":41,"tag":685,"props":4562,"children":4563},{"class":687,"line":740},[4564,4569,4573,4577,4582,4586,4590,4595,4599,4603,4607,4611,4615,4619,4623],{"type":41,"tag":685,"props":4565,"children":4566},{"style":892},[4567],{"type":47,"value":4568},"  lints",{"type":41,"tag":685,"props":4570,"children":4571},{"style":708},[4572],{"type":47,"value":915},{"type":41,"tag":685,"props":4574,"children":4575},{"style":719},[4576],{"type":47,"value":1482},{"type":41,"tag":685,"props":4578,"children":4579},{"style":829},[4580],{"type":47,"value":4581}," severities",{"type":41,"tag":685,"props":4583,"children":4584},{"style":719},[4585],{"type":47,"value":836},{"type":41,"tag":685,"props":4587,"children":4588},{"style":719},[4589],{"type":47,"value":755},{"type":41,"tag":685,"props":4591,"children":4592},{"style":829},[4593],{"type":47,"value":4594}," noLimit",{"type":41,"tag":685,"props":4596,"children":4597},{"style":719},[4598],{"type":47,"value":836},{"type":41,"tag":685,"props":4600,"children":4601},{"style":719},[4602],{"type":47,"value":722},{"type":41,"tag":685,"props":4604,"children":4605},{"style":725},[4606],{"type":47,"value":4052},{"type":41,"tag":685,"props":4608,"children":4609},{"style":719},[4610],{"type":47,"value":732},{"type":41,"tag":685,"props":4612,"children":4613},{"style":719},[4614],{"type":47,"value":765},{"type":41,"tag":685,"props":4616,"children":4617},{"style":719},[4618],{"type":47,"value":765},{"type":41,"tag":685,"props":4620,"children":4621},{"style":708},[4622],{"type":47,"value":996},{"type":41,"tag":685,"props":4624,"children":4625},{"style":719},[4626],{"type":47,"value":934},{"type":41,"tag":685,"props":4628,"children":4629},{"class":687,"line":790},[4630,4635,4639,4643,4648,4652,4657,4661,4665,4669],{"type":41,"tag":685,"props":4631,"children":4632},{"style":892},[4633],{"type":47,"value":4634},"  budgets",{"type":41,"tag":685,"props":4636,"children":4637},{"style":708},[4638],{"type":47,"value":915},{"type":41,"tag":685,"props":4640,"children":4641},{"style":719},[4642],{"type":47,"value":1482},{"type":41,"tag":685,"props":4644,"children":4645},{"style":829},[4646],{"type":47,"value":4647}," maxLatencyMs",{"type":41,"tag":685,"props":4649,"children":4650},{"style":719},[4651],{"type":47,"value":836},{"type":41,"tag":685,"props":4653,"children":4654},{"style":4201},[4655],{"type":47,"value":4656}," 5_000",{"type":41,"tag":685,"props":4658,"children":4659},{"style":719},[4660],{"type":47,"value":765},{"type":41,"tag":685,"props":4662,"children":4663},{"style":708},[4664],{"type":47,"value":996},{"type":41,"tag":685,"props":4666,"children":4667},{"style":719},[4668],{"type":47,"value":1509},{"type":41,"tag":685,"props":4670,"children":4671},{"style":692},[4672],{"type":47,"value":4673},"         \u002F\u002F innermost — runs closest to the driver\n",{"type":41,"tag":685,"props":4675,"children":4676},{"class":687,"line":857},[4677,4681],{"type":41,"tag":685,"props":4678,"children":4679},{"style":708},[4680],{"type":47,"value":978},{"type":41,"tag":685,"props":4682,"children":4683},{"style":719},[4684],{"type":47,"value":934},{"type":41,"tag":63,"props":4686,"children":4687},{},[4688],{"type":47,"value":4689},"Order matters: outermost wraps. Telemetry first means budget \u002F lint failures are captured as spans (the agent can correlate the lint code with the operation in the same trace).",{"type":41,"tag":92,"props":4691,"children":4693},{"id":4692},"workflow-configure-the-connection",[4694],{"type":47,"value":4695},"Workflow — Configure the connection",{"type":41,"tag":63,"props":4697,"children":4698},{},[4699,4701,4706,4707,4713,4715,4720,4721,4726,4728,4733,4735,4740,4742,4747,4749,4755,4756,4762,4763,4767,4768,4774],{"type":47,"value":4700},"The concept: the runtime takes one of three binding shapes — ",{"type":41,"tag":50,"props":4702,"children":4704},{"className":4703},[],[4705],{"type":47,"value":1125},{"type":47,"value":163},{"type":41,"tag":50,"props":4708,"children":4710},{"className":4709},[],[4711],{"type":47,"value":4712},"pg",{"type":47,"value":4714}," (a pre-constructed ",{"type":41,"tag":50,"props":4716,"children":4718},{"className":4717},[],[4719],{"type":47,"value":1311},{"type":47,"value":1051},{"type":41,"tag":50,"props":4722,"children":4724},{"className":4723},[],[4725],{"type":47,"value":3029},{"type":47,"value":4727},"), or ",{"type":41,"tag":50,"props":4729,"children":4731},{"className":4730},[],[4732],{"type":47,"value":3061},{"type":47,"value":4734}," (an explicit kind tag). They're mutually exclusive. The ",{"type":41,"tag":50,"props":4736,"children":4738},{"className":4737},[],[4739],{"type":47,"value":4712},{"type":47,"value":4741}," form is for projects that already manage their own pool (e.g. a Lambda layer); ",{"type":41,"tag":50,"props":4743,"children":4745},{"className":4744},[],[4746],{"type":47,"value":1125},{"type":47,"value":4748}," is the default. Pool tuning is ",{"type":41,"tag":50,"props":4750,"children":4752},{"className":4751},[],[4753],{"type":47,"value":4754},"poolOptions.connectionTimeoutMillis",{"type":47,"value":226},{"type":41,"tag":50,"props":4757,"children":4759},{"className":4758},[],[4760],{"type":47,"value":4761},"poolOptions.idleTimeoutMillis",{"type":47,"value":83},{"type":41,"tag":178,"props":4764,"children":4765},{},[4766],{"type":47,"value":3074},{"type":47,"value":595},{"type":41,"tag":50,"props":4769,"children":4771},{"className":4770},[],[4772],{"type":47,"value":4773},"driverOptions",{"type":47,"value":184},{"type":41,"tag":674,"props":4776,"children":4778},{"className":676,"code":4777,"language":678,"meta":679,"style":679},"\u002F\u002F Default — URL string, factory constructs the pool.\npostgres\u003CContract>({\n  contractJson,\n  url: process.env['DATABASE_URL'],\n  poolOptions: {\n    connectionTimeoutMillis: 20_000,\n    idleTimeoutMillis: 30_000,\n  },\n});\n\n\u002F\u002F BYO pool — pass a pg.Pool you already created.\nimport { Pool } from 'pg';\nconst pool = new Pool({ connectionString: process.env['DATABASE_URL'] });\npostgres\u003CContract>({ contractJson, pg: pool });\n",[4779],{"type":41,"tag":50,"props":4780,"children":4781},{"__ignoreMap":679},[4782,4790,4818,4829,4872,4888,4909,4930,4938,4953,4960,4968,5008,5091],{"type":41,"tag":685,"props":4783,"children":4784},{"class":687,"line":688},[4785],{"type":41,"tag":685,"props":4786,"children":4787},{"style":692},[4788],{"type":47,"value":4789},"\u002F\u002F Default — URL string, factory constructs the pool.\n",{"type":41,"tag":685,"props":4791,"children":4792},{"class":687,"line":698},[4793,4798,4802,4806,4810,4814],{"type":41,"tag":685,"props":4794,"children":4795},{"style":892},[4796],{"type":47,"value":4797},"postgres",{"type":41,"tag":685,"props":4799,"children":4800},{"style":719},[4801],{"type":47,"value":900},{"type":41,"tag":685,"props":4803,"children":4804},{"style":903},[4805],{"type":47,"value":365},{"type":41,"tag":685,"props":4807,"children":4808},{"style":719},[4809],{"type":47,"value":910},{"type":41,"tag":685,"props":4811,"children":4812},{"style":708},[4813],{"type":47,"value":915},{"type":41,"tag":685,"props":4815,"children":4816},{"style":719},[4817],{"type":47,"value":920},{"type":41,"tag":685,"props":4819,"children":4820},{"class":687,"line":740},[4821,4825],{"type":41,"tag":685,"props":4822,"children":4823},{"style":708},[4824],{"type":47,"value":929},{"type":41,"tag":685,"props":4826,"children":4827},{"style":719},[4828],{"type":47,"value":934},{"type":41,"tag":685,"props":4830,"children":4831},{"class":687,"line":790},[4832,4836,4840,4844,4848,4852,4856,4860,4864,4868],{"type":41,"tag":685,"props":4833,"children":4834},{"style":829},[4835],{"type":47,"value":943},{"type":41,"tag":685,"props":4837,"children":4838},{"style":719},[4839],{"type":47,"value":836},{"type":41,"tag":685,"props":4841,"children":4842},{"style":708},[4843],{"type":47,"value":952},{"type":41,"tag":685,"props":4845,"children":4846},{"style":719},[4847],{"type":47,"value":184},{"type":41,"tag":685,"props":4849,"children":4850},{"style":708},[4851],{"type":47,"value":961},{"type":41,"tag":685,"props":4853,"children":4854},{"style":719},[4855],{"type":47,"value":732},{"type":41,"tag":685,"props":4857,"children":4858},{"style":725},[4859],{"type":47,"value":561},{"type":41,"tag":685,"props":4861,"children":4862},{"style":719},[4863],{"type":47,"value":732},{"type":41,"tag":685,"props":4865,"children":4866},{"style":708},[4867],{"type":47,"value":978},{"type":41,"tag":685,"props":4869,"children":4870},{"style":719},[4871],{"type":47,"value":934},{"type":41,"tag":685,"props":4873,"children":4874},{"class":687,"line":857},[4875,4880,4884],{"type":41,"tag":685,"props":4876,"children":4877},{"style":829},[4878],{"type":47,"value":4879},"  poolOptions",{"type":41,"tag":685,"props":4881,"children":4882},{"style":719},[4883],{"type":47,"value":836},{"type":41,"tag":685,"props":4885,"children":4886},{"style":719},[4887],{"type":47,"value":2212},{"type":41,"tag":685,"props":4889,"children":4890},{"class":687,"line":867},[4891,4896,4900,4905],{"type":41,"tag":685,"props":4892,"children":4893},{"style":829},[4894],{"type":47,"value":4895},"    connectionTimeoutMillis",{"type":41,"tag":685,"props":4897,"children":4898},{"style":719},[4899],{"type":47,"value":836},{"type":41,"tag":685,"props":4901,"children":4902},{"style":4201},[4903],{"type":47,"value":4904}," 20_000",{"type":41,"tag":685,"props":4906,"children":4907},{"style":719},[4908],{"type":47,"value":934},{"type":41,"tag":685,"props":4910,"children":4911},{"class":687,"line":923},[4912,4917,4921,4926],{"type":41,"tag":685,"props":4913,"children":4914},{"style":829},[4915],{"type":47,"value":4916},"    idleTimeoutMillis",{"type":41,"tag":685,"props":4918,"children":4919},{"style":719},[4920],{"type":47,"value":836},{"type":41,"tag":685,"props":4922,"children":4923},{"style":4201},[4924],{"type":47,"value":4925}," 30_000",{"type":41,"tag":685,"props":4927,"children":4928},{"style":719},[4929],{"type":47,"value":934},{"type":41,"tag":685,"props":4931,"children":4932},{"class":687,"line":937},[4933],{"type":41,"tag":685,"props":4934,"children":4935},{"style":719},[4936],{"type":47,"value":4937},"  },\n",{"type":41,"tag":685,"props":4939,"children":4940},{"class":687,"line":985},[4941,4945,4949],{"type":41,"tag":685,"props":4942,"children":4943},{"style":719},[4944],{"type":47,"value":991},{"type":41,"tag":685,"props":4946,"children":4947},{"style":708},[4948],{"type":47,"value":996},{"type":41,"tag":685,"props":4950,"children":4951},{"style":719},[4952],{"type":47,"value":737},{"type":41,"tag":685,"props":4954,"children":4955},{"class":687,"line":2062},[4956],{"type":41,"tag":685,"props":4957,"children":4958},{"emptyLinePlaceholder":861},[4959],{"type":47,"value":864},{"type":41,"tag":685,"props":4961,"children":4962},{"class":687,"line":3460},[4963],{"type":41,"tag":685,"props":4964,"children":4965},{"style":692},[4966],{"type":47,"value":4967},"\u002F\u002F BYO pool — pass a pg.Pool you already created.\n",{"type":41,"tag":685,"props":4969,"children":4970},{"class":687,"line":3494},[4971,4975,4979,4984,4988,4992,4996,5000,5004],{"type":41,"tag":685,"props":4972,"children":4973},{"style":702},[4974],{"type":47,"value":705},{"type":41,"tag":685,"props":4976,"children":4977},{"style":719},[4978],{"type":47,"value":755},{"type":41,"tag":685,"props":4980,"children":4981},{"style":708},[4982],{"type":47,"value":4983}," Pool",{"type":41,"tag":685,"props":4985,"children":4986},{"style":719},[4987],{"type":47,"value":765},{"type":41,"tag":685,"props":4989,"children":4990},{"style":702},[4991],{"type":47,"value":770},{"type":41,"tag":685,"props":4993,"children":4994},{"style":719},[4995],{"type":47,"value":722},{"type":41,"tag":685,"props":4997,"children":4998},{"style":725},[4999],{"type":47,"value":4712},{"type":41,"tag":685,"props":5001,"children":5002},{"style":719},[5003],{"type":47,"value":732},{"type":41,"tag":685,"props":5005,"children":5006},{"style":719},[5007],{"type":47,"value":737},{"type":41,"tag":685,"props":5009,"children":5010},{"class":687,"line":3503},[5011,5015,5020,5024,5029,5033,5037,5041,5046,5050,5054,5058,5062,5066,5070,5074,5079,5083,5087],{"type":41,"tag":685,"props":5012,"children":5013},{"style":876},[5014],{"type":47,"value":1428},{"type":41,"tag":685,"props":5016,"children":5017},{"style":708},[5018],{"type":47,"value":5019}," pool ",{"type":41,"tag":685,"props":5021,"children":5022},{"style":719},[5023],{"type":47,"value":889},{"type":41,"tag":685,"props":5025,"children":5026},{"style":719},[5027],{"type":47,"value":5028}," new",{"type":41,"tag":685,"props":5030,"children":5031},{"style":892},[5032],{"type":47,"value":4983},{"type":41,"tag":685,"props":5034,"children":5035},{"style":708},[5036],{"type":47,"value":915},{"type":41,"tag":685,"props":5038,"children":5039},{"style":719},[5040],{"type":47,"value":1482},{"type":41,"tag":685,"props":5042,"children":5043},{"style":829},[5044],{"type":47,"value":5045}," connectionString",{"type":41,"tag":685,"props":5047,"children":5048},{"style":719},[5049],{"type":47,"value":836},{"type":41,"tag":685,"props":5051,"children":5052},{"style":708},[5053],{"type":47,"value":952},{"type":41,"tag":685,"props":5055,"children":5056},{"style":719},[5057],{"type":47,"value":184},{"type":41,"tag":685,"props":5059,"children":5060},{"style":708},[5061],{"type":47,"value":961},{"type":41,"tag":685,"props":5063,"children":5064},{"style":719},[5065],{"type":47,"value":732},{"type":41,"tag":685,"props":5067,"children":5068},{"style":725},[5069],{"type":47,"value":561},{"type":41,"tag":685,"props":5071,"children":5072},{"style":719},[5073],{"type":47,"value":732},{"type":41,"tag":685,"props":5075,"children":5076},{"style":708},[5077],{"type":47,"value":5078},"] ",{"type":41,"tag":685,"props":5080,"children":5081},{"style":719},[5082],{"type":47,"value":991},{"type":41,"tag":685,"props":5084,"children":5085},{"style":708},[5086],{"type":47,"value":996},{"type":41,"tag":685,"props":5088,"children":5089},{"style":719},[5090],{"type":47,"value":737},{"type":41,"tag":685,"props":5092,"children":5093},{"class":687,"line":3512},[5094,5098,5102,5106,5110,5114,5118,5122,5126,5131,5135,5139,5143,5147],{"type":41,"tag":685,"props":5095,"children":5096},{"style":892},[5097],{"type":47,"value":4797},{"type":41,"tag":685,"props":5099,"children":5100},{"style":719},[5101],{"type":47,"value":900},{"type":41,"tag":685,"props":5103,"children":5104},{"style":903},[5105],{"type":47,"value":365},{"type":41,"tag":685,"props":5107,"children":5108},{"style":719},[5109],{"type":47,"value":910},{"type":41,"tag":685,"props":5111,"children":5112},{"style":708},[5113],{"type":47,"value":915},{"type":41,"tag":685,"props":5115,"children":5116},{"style":719},[5117],{"type":47,"value":1482},{"type":41,"tag":685,"props":5119,"children":5120},{"style":708},[5121],{"type":47,"value":1921},{"type":41,"tag":685,"props":5123,"children":5124},{"style":719},[5125],{"type":47,"value":1509},{"type":41,"tag":685,"props":5127,"children":5128},{"style":829},[5129],{"type":47,"value":5130}," pg",{"type":41,"tag":685,"props":5132,"children":5133},{"style":719},[5134],{"type":47,"value":836},{"type":41,"tag":685,"props":5136,"children":5137},{"style":708},[5138],{"type":47,"value":5019},{"type":41,"tag":685,"props":5140,"children":5141},{"style":719},[5142],{"type":47,"value":991},{"type":41,"tag":685,"props":5144,"children":5145},{"style":708},[5146],{"type":47,"value":996},{"type":41,"tag":685,"props":5148,"children":5149},{"style":719},[5150],{"type":47,"value":737},{"type":41,"tag":63,"props":5152,"children":5153},{},[5154,5156,5161,5162,5167],{"type":47,"value":5155},"The ",{"type":41,"tag":50,"props":5157,"children":5159},{"className":5158},[],[5160],{"type":47,"value":1125},{"type":47,"value":2790},{"type":41,"tag":50,"props":5163,"children":5165},{"className":5164},[],[5166],{"type":47,"value":4712},{"type":47,"value":5168}," keys are mutually exclusive at the type level; passing both errors.",{"type":41,"tag":63,"props":5170,"children":5171},{},[5172,5177,5179,5184,5186,5192,5194,5199],{"type":41,"tag":50,"props":5173,"children":5175},{"className":5174},[],[5176],{"type":47,"value":561},{"type":47,"value":5178}," lives in ",{"type":41,"tag":50,"props":5180,"children":5182},{"className":5181},[],[5183],{"type":47,"value":537},{"type":47,"value":5185},". The CLI reads it for emit \u002F verify \u002F migration commands; the runtime reads it through ",{"type":41,"tag":50,"props":5187,"children":5189},{"className":5188},[],[5190],{"type":47,"value":5191},"process.env",{"type":47,"value":5193}," at ",{"type":41,"tag":50,"props":5195,"children":5197},{"className":5196},[],[5198],{"type":47,"value":55},{"type":47,"value":5200}," load time.",{"type":41,"tag":92,"props":5202,"children":5204},{"id":5203},"workflow-per-environment-config-dev-vs-prod",[5205],{"type":47,"value":5206},"Workflow — Per-environment config (dev vs prod)",{"type":41,"tag":63,"props":5208,"children":5209},{},[5210,5212,5217,5219,5224,5226,5231,5233,5239],{"type":47,"value":5211},"The concept: one ",{"type":41,"tag":50,"props":5213,"children":5215},{"className":5214},[],[5216],{"type":47,"value":561},{"type":47,"value":5218}," per environment; the rest of the ",{"type":41,"tag":50,"props":5220,"children":5222},{"className":5221},[],[5223],{"type":47,"value":55},{"type":47,"value":5225}," shape is the same. For middleware divergence (e.g. strict lints in dev only), branch in ",{"type":41,"tag":50,"props":5227,"children":5229},{"className":5228},[],[5230],{"type":47,"value":55},{"type":47,"value":5232}," on ",{"type":41,"tag":50,"props":5234,"children":5236},{"className":5235},[],[5237],{"type":47,"value":5238},"process.env['NODE_ENV']",{"type":47,"value":184},{"type":41,"tag":674,"props":5241,"children":5243},{"className":676,"code":5242,"language":678,"meta":679,"style":679},"const isProd = process.env['NODE_ENV'] === 'production';\n\nexport const db = postgres\u003CContract>({\n  contractJson,\n  url: process.env['DATABASE_URL'],\n  middleware: isProd\n    ? [createTelemetryMiddleware({ onEvent })]\n    : [\n        createTelemetryMiddleware({ onEvent }),\n        lints({ severities: { noLimit: 'error', deleteWithoutWhere: 'error' } }),\n      ],\n});\n",[5244],{"type":41,"tag":50,"props":5245,"children":5246},{"__ignoreMap":679},[5247,5314,5321,5364,5375,5418,5434,5472,5484,5516,5605,5617],{"type":41,"tag":685,"props":5248,"children":5249},{"class":687,"line":688},[5250,5254,5259,5263,5267,5271,5275,5279,5284,5288,5292,5297,5301,5306,5310],{"type":41,"tag":685,"props":5251,"children":5252},{"style":876},[5253],{"type":47,"value":1428},{"type":41,"tag":685,"props":5255,"children":5256},{"style":708},[5257],{"type":47,"value":5258}," isProd ",{"type":41,"tag":685,"props":5260,"children":5261},{"style":719},[5262],{"type":47,"value":889},{"type":41,"tag":685,"props":5264,"children":5265},{"style":708},[5266],{"type":47,"value":952},{"type":41,"tag":685,"props":5268,"children":5269},{"style":719},[5270],{"type":47,"value":184},{"type":41,"tag":685,"props":5272,"children":5273},{"style":708},[5274],{"type":47,"value":961},{"type":41,"tag":685,"props":5276,"children":5277},{"style":719},[5278],{"type":47,"value":732},{"type":41,"tag":685,"props":5280,"children":5281},{"style":725},[5282],{"type":47,"value":5283},"NODE_ENV",{"type":41,"tag":685,"props":5285,"children":5286},{"style":719},[5287],{"type":47,"value":732},{"type":41,"tag":685,"props":5289,"children":5290},{"style":708},[5291],{"type":47,"value":5078},{"type":41,"tag":685,"props":5293,"children":5294},{"style":719},[5295],{"type":47,"value":5296},"===",{"type":41,"tag":685,"props":5298,"children":5299},{"style":719},[5300],{"type":47,"value":722},{"type":41,"tag":685,"props":5302,"children":5303},{"style":725},[5304],{"type":47,"value":5305},"production",{"type":41,"tag":685,"props":5307,"children":5308},{"style":719},[5309],{"type":47,"value":732},{"type":41,"tag":685,"props":5311,"children":5312},{"style":719},[5313],{"type":47,"value":737},{"type":41,"tag":685,"props":5315,"children":5316},{"class":687,"line":698},[5317],{"type":41,"tag":685,"props":5318,"children":5319},{"emptyLinePlaceholder":861},[5320],{"type":47,"value":864},{"type":41,"tag":685,"props":5322,"children":5323},{"class":687,"line":740},[5324,5328,5332,5336,5340,5344,5348,5352,5356,5360],{"type":41,"tag":685,"props":5325,"children":5326},{"style":702},[5327],{"type":47,"value":873},{"type":41,"tag":685,"props":5329,"children":5330},{"style":876},[5331],{"type":47,"value":879},{"type":41,"tag":685,"props":5333,"children":5334},{"style":708},[5335],{"type":47,"value":884},{"type":41,"tag":685,"props":5337,"children":5338},{"style":719},[5339],{"type":47,"value":889},{"type":41,"tag":685,"props":5341,"children":5342},{"style":892},[5343],{"type":47,"value":895},{"type":41,"tag":685,"props":5345,"children":5346},{"style":719},[5347],{"type":47,"value":900},{"type":41,"tag":685,"props":5349,"children":5350},{"style":903},[5351],{"type":47,"value":365},{"type":41,"tag":685,"props":5353,"children":5354},{"style":719},[5355],{"type":47,"value":910},{"type":41,"tag":685,"props":5357,"children":5358},{"style":708},[5359],{"type":47,"value":915},{"type":41,"tag":685,"props":5361,"children":5362},{"style":719},[5363],{"type":47,"value":920},{"type":41,"tag":685,"props":5365,"children":5366},{"class":687,"line":790},[5367,5371],{"type":41,"tag":685,"props":5368,"children":5369},{"style":708},[5370],{"type":47,"value":929},{"type":41,"tag":685,"props":5372,"children":5373},{"style":719},[5374],{"type":47,"value":934},{"type":41,"tag":685,"props":5376,"children":5377},{"class":687,"line":857},[5378,5382,5386,5390,5394,5398,5402,5406,5410,5414],{"type":41,"tag":685,"props":5379,"children":5380},{"style":829},[5381],{"type":47,"value":943},{"type":41,"tag":685,"props":5383,"children":5384},{"style":719},[5385],{"type":47,"value":836},{"type":41,"tag":685,"props":5387,"children":5388},{"style":708},[5389],{"type":47,"value":952},{"type":41,"tag":685,"props":5391,"children":5392},{"style":719},[5393],{"type":47,"value":184},{"type":41,"tag":685,"props":5395,"children":5396},{"style":708},[5397],{"type":47,"value":961},{"type":41,"tag":685,"props":5399,"children":5400},{"style":719},[5401],{"type":47,"value":732},{"type":41,"tag":685,"props":5403,"children":5404},{"style":725},[5405],{"type":47,"value":561},{"type":41,"tag":685,"props":5407,"children":5408},{"style":719},[5409],{"type":47,"value":732},{"type":41,"tag":685,"props":5411,"children":5412},{"style":708},[5413],{"type":47,"value":978},{"type":41,"tag":685,"props":5415,"children":5416},{"style":719},[5417],{"type":47,"value":934},{"type":41,"tag":685,"props":5419,"children":5420},{"class":687,"line":867},[5421,5425,5429],{"type":41,"tag":685,"props":5422,"children":5423},{"style":829},[5424],{"type":47,"value":3432},{"type":41,"tag":685,"props":5426,"children":5427},{"style":719},[5428],{"type":47,"value":836},{"type":41,"tag":685,"props":5430,"children":5431},{"style":708},[5432],{"type":47,"value":5433}," isProd\n",{"type":41,"tag":685,"props":5435,"children":5436},{"class":687,"line":923},[5437,5442,5447,5451,5455,5459,5463,5467],{"type":41,"tag":685,"props":5438,"children":5439},{"style":719},[5440],{"type":47,"value":5441},"    ?",{"type":41,"tag":685,"props":5443,"children":5444},{"style":708},[5445],{"type":47,"value":5446}," [",{"type":41,"tag":685,"props":5448,"children":5449},{"style":892},[5450],{"type":47,"value":3563},{"type":41,"tag":685,"props":5452,"children":5453},{"style":708},[5454],{"type":47,"value":915},{"type":41,"tag":685,"props":5456,"children":5457},{"style":719},[5458],{"type":47,"value":1482},{"type":41,"tag":685,"props":5460,"children":5461},{"style":708},[5462],{"type":47,"value":4543},{"type":41,"tag":685,"props":5464,"children":5465},{"style":719},[5466],{"type":47,"value":991},{"type":41,"tag":685,"props":5468,"children":5469},{"style":708},[5470],{"type":47,"value":5471},")]\n",{"type":41,"tag":685,"props":5473,"children":5474},{"class":687,"line":937},[5475,5480],{"type":41,"tag":685,"props":5476,"children":5477},{"style":719},[5478],{"type":47,"value":5479},"    :",{"type":41,"tag":685,"props":5481,"children":5482},{"style":708},[5483],{"type":47,"value":3441},{"type":41,"tag":685,"props":5485,"children":5486},{"class":687,"line":985},[5487,5492,5496,5500,5504,5508,5512],{"type":41,"tag":685,"props":5488,"children":5489},{"style":892},[5490],{"type":47,"value":5491},"        createTelemetryMiddleware",{"type":41,"tag":685,"props":5493,"children":5494},{"style":708},[5495],{"type":47,"value":915},{"type":41,"tag":685,"props":5497,"children":5498},{"style":719},[5499],{"type":47,"value":1482},{"type":41,"tag":685,"props":5501,"children":5502},{"style":708},[5503],{"type":47,"value":4543},{"type":41,"tag":685,"props":5505,"children":5506},{"style":719},[5507],{"type":47,"value":991},{"type":41,"tag":685,"props":5509,"children":5510},{"style":708},[5511],{"type":47,"value":996},{"type":41,"tag":685,"props":5513,"children":5514},{"style":719},[5515],{"type":47,"value":934},{"type":41,"tag":685,"props":5517,"children":5518},{"class":687,"line":2062},[5519,5524,5528,5532,5536,5540,5544,5548,5552,5556,5560,5564,5568,5573,5577,5581,5585,5589,5593,5597,5601],{"type":41,"tag":685,"props":5520,"children":5521},{"style":892},[5522],{"type":47,"value":5523},"        lints",{"type":41,"tag":685,"props":5525,"children":5526},{"style":708},[5527],{"type":47,"value":915},{"type":41,"tag":685,"props":5529,"children":5530},{"style":719},[5531],{"type":47,"value":1482},{"type":41,"tag":685,"props":5533,"children":5534},{"style":829},[5535],{"type":47,"value":4581},{"type":41,"tag":685,"props":5537,"children":5538},{"style":719},[5539],{"type":47,"value":836},{"type":41,"tag":685,"props":5541,"children":5542},{"style":719},[5543],{"type":47,"value":755},{"type":41,"tag":685,"props":5545,"children":5546},{"style":829},[5547],{"type":47,"value":4594},{"type":41,"tag":685,"props":5549,"children":5550},{"style":719},[5551],{"type":47,"value":836},{"type":41,"tag":685,"props":5553,"children":5554},{"style":719},[5555],{"type":47,"value":722},{"type":41,"tag":685,"props":5557,"children":5558},{"style":725},[5559],{"type":47,"value":4052},{"type":41,"tag":685,"props":5561,"children":5562},{"style":719},[5563],{"type":47,"value":732},{"type":41,"tag":685,"props":5565,"children":5566},{"style":719},[5567],{"type":47,"value":1509},{"type":41,"tag":685,"props":5569,"children":5570},{"style":829},[5571],{"type":47,"value":5572}," deleteWithoutWhere",{"type":41,"tag":685,"props":5574,"children":5575},{"style":719},[5576],{"type":47,"value":836},{"type":41,"tag":685,"props":5578,"children":5579},{"style":719},[5580],{"type":47,"value":722},{"type":41,"tag":685,"props":5582,"children":5583},{"style":725},[5584],{"type":47,"value":4052},{"type":41,"tag":685,"props":5586,"children":5587},{"style":719},[5588],{"type":47,"value":732},{"type":41,"tag":685,"props":5590,"children":5591},{"style":719},[5592],{"type":47,"value":765},{"type":41,"tag":685,"props":5594,"children":5595},{"style":719},[5596],{"type":47,"value":765},{"type":41,"tag":685,"props":5598,"children":5599},{"style":708},[5600],{"type":47,"value":996},{"type":41,"tag":685,"props":5602,"children":5603},{"style":719},[5604],{"type":47,"value":934},{"type":41,"tag":685,"props":5606,"children":5607},{"class":687,"line":3460},[5608,5613],{"type":41,"tag":685,"props":5609,"children":5610},{"style":708},[5611],{"type":47,"value":5612},"      ]",{"type":41,"tag":685,"props":5614,"children":5615},{"style":719},[5616],{"type":47,"value":934},{"type":41,"tag":685,"props":5618,"children":5619},{"class":687,"line":3494},[5620,5624,5628],{"type":41,"tag":685,"props":5621,"children":5622},{"style":719},[5623],{"type":47,"value":991},{"type":41,"tag":685,"props":5625,"children":5626},{"style":708},[5627],{"type":47,"value":996},{"type":41,"tag":685,"props":5629,"children":5630},{"style":719},[5631],{"type":47,"value":737},{"type":41,"tag":63,"props":5633,"children":5634},{},[5635,5640,5642,5647],{"type":41,"tag":50,"props":5636,"children":5638},{"className":5637},[],[5639],{"type":47,"value":537},{"type":47,"value":5641}," for local; the deploy platform's secrets for prod. Never commit ",{"type":41,"tag":50,"props":5643,"children":5645},{"className":5644},[],[5646],{"type":47,"value":537},{"type":47,"value":184},{"type":41,"tag":92,"props":5649,"children":5651},{"id":5650},"workflow-transactions",[5652],{"type":47,"value":5653},"Workflow — Transactions",{"type":41,"tag":63,"props":5655,"children":5656},{},[5657,5659,5664,5666,5672,5674,5680,5682,5688,5689,5694,5696,5701,5703,5709,5710,5716,5718,5723,5724,5729,5731,5736],{"type":47,"value":5658},"The concept applies to ",{"type":41,"tag":67,"props":5660,"children":5661},{},[5662],{"type":47,"value":5663},"Postgres and SQLite",{"type":47,"value":5665},". ",{"type":41,"tag":50,"props":5667,"children":5669},{"className":5668},[],[5670],{"type":47,"value":5671},"db.transaction(fn)",{"type":47,"value":5673}," opens a transaction, gives the callback a ",{"type":41,"tag":50,"props":5675,"children":5677},{"className":5676},[],[5678],{"type":47,"value":5679},"tx",{"type":47,"value":5681}," context with the same ",{"type":41,"tag":50,"props":5683,"children":5685},{"className":5684},[],[5686],{"type":47,"value":5687},"sql",{"type":47,"value":226},{"type":41,"tag":50,"props":5690,"children":5692},{"className":5691},[],[5693],{"type":47,"value":1455},{"type":47,"value":5695}," surfaces as ",{"type":41,"tag":50,"props":5697,"children":5699},{"className":5698},[],[5700],{"type":47,"value":381},{"type":47,"value":5702},", and commits on successful return \u002F rolls back on any thrown error. Inside the callback, use ",{"type":41,"tag":50,"props":5704,"children":5706},{"className":5705},[],[5707],{"type":47,"value":5708},"tx.sql",{"type":47,"value":2790},{"type":41,"tag":50,"props":5711,"children":5713},{"className":5712},[],[5714],{"type":47,"value":5715},"tx.orm",{"type":47,"value":5717}," instead of ",{"type":41,"tag":50,"props":5719,"children":5721},{"className":5720},[],[5722],{"type":47,"value":468},{"type":47,"value":226},{"type":41,"tag":50,"props":5725,"children":5727},{"className":5726},[],[5728],{"type":47,"value":475},{"type":47,"value":5730}," so the writes ride the transaction. The Mongo façade does not expose ",{"type":41,"tag":50,"props":5732,"children":5734},{"className":5733},[],[5735],{"type":47,"value":140},{"type":47,"value":184},{"type":41,"tag":674,"props":5738,"children":5740},{"className":676,"code":5739,"language":678,"meta":679,"style":679},"await db.transaction(async (tx) => {\n  const user = await tx.orm.User.create({ email: 'alice@example.com' });\n  await tx.orm.Post.create({ userId: user.id, title: 'hello' });\n  \u002F\u002F If either call throws, both inserts roll back.\n});\n",[5741],{"type":41,"tag":50,"props":5742,"children":5743},{"__ignoreMap":679},[5744,5793,5881,5986,5994],{"type":41,"tag":685,"props":5745,"children":5746},{"class":687,"line":688},[5747,5751,5755,5759,5764,5768,5773,5777,5781,5785,5789],{"type":41,"tag":685,"props":5748,"children":5749},{"style":702},[5750],{"type":47,"value":1666},{"type":41,"tag":685,"props":5752,"children":5753},{"style":708},[5754],{"type":47,"value":1389},{"type":41,"tag":685,"props":5756,"children":5757},{"style":719},[5758],{"type":47,"value":184},{"type":41,"tag":685,"props":5760,"children":5761},{"style":892},[5762],{"type":47,"value":5763},"transaction",{"type":41,"tag":685,"props":5765,"children":5766},{"style":708},[5767],{"type":47,"value":915},{"type":41,"tag":685,"props":5769,"children":5770},{"style":876},[5771],{"type":47,"value":5772},"async",{"type":41,"tag":685,"props":5774,"children":5775},{"style":719},[5776],{"type":47,"value":2183},{"type":41,"tag":685,"props":5778,"children":5779},{"style":2186},[5780],{"type":47,"value":5679},{"type":41,"tag":685,"props":5782,"children":5783},{"style":719},[5784],{"type":47,"value":996},{"type":41,"tag":685,"props":5786,"children":5787},{"style":876},[5788],{"type":47,"value":2207},{"type":41,"tag":685,"props":5790,"children":5791},{"style":719},[5792],{"type":47,"value":2212},{"type":41,"tag":685,"props":5794,"children":5795},{"class":687,"line":698},[5796,5800,5804,5808,5812,5817,5821,5825,5829,5833,5837,5841,5845,5849,5853,5857,5861,5865,5869,5873,5877],{"type":41,"tag":685,"props":5797,"children":5798},{"style":876},[5799],{"type":47,"value":2313},{"type":41,"tag":685,"props":5801,"children":5802},{"style":708},[5803],{"type":47,"value":4251},{"type":41,"tag":685,"props":5805,"children":5806},{"style":719},[5807],{"type":47,"value":2229},{"type":41,"tag":685,"props":5809,"children":5810},{"style":702},[5811],{"type":47,"value":1442},{"type":41,"tag":685,"props":5813,"children":5814},{"style":708},[5815],{"type":47,"value":5816}," tx",{"type":41,"tag":685,"props":5818,"children":5819},{"style":719},[5820],{"type":47,"value":184},{"type":41,"tag":685,"props":5822,"children":5823},{"style":708},[5824],{"type":47,"value":1455},{"type":41,"tag":685,"props":5826,"children":5827},{"style":719},[5828],{"type":47,"value":184},{"type":41,"tag":685,"props":5830,"children":5831},{"style":708},[5832],{"type":47,"value":1464},{"type":41,"tag":685,"props":5834,"children":5835},{"style":719},[5836],{"type":47,"value":184},{"type":41,"tag":685,"props":5838,"children":5839},{"style":892},[5840],{"type":47,"value":1473},{"type":41,"tag":685,"props":5842,"children":5843},{"style":829},[5844],{"type":47,"value":915},{"type":41,"tag":685,"props":5846,"children":5847},{"style":719},[5848],{"type":47,"value":1482},{"type":41,"tag":685,"props":5850,"children":5851},{"style":829},[5852],{"type":47,"value":1487},{"type":41,"tag":685,"props":5854,"children":5855},{"style":719},[5856],{"type":47,"value":836},{"type":41,"tag":685,"props":5858,"children":5859},{"style":719},[5860],{"type":47,"value":722},{"type":41,"tag":685,"props":5862,"children":5863},{"style":725},[5864],{"type":47,"value":1500},{"type":41,"tag":685,"props":5866,"children":5867},{"style":719},[5868],{"type":47,"value":732},{"type":41,"tag":685,"props":5870,"children":5871},{"style":719},[5872],{"type":47,"value":765},{"type":41,"tag":685,"props":5874,"children":5875},{"style":829},[5876],{"type":47,"value":996},{"type":41,"tag":685,"props":5878,"children":5879},{"style":719},[5880],{"type":47,"value":737},{"type":41,"tag":685,"props":5882,"children":5883},{"class":687,"line":740},[5884,5889,5893,5897,5901,5905,5910,5914,5918,5922,5926,5931,5935,5939,5943,5948,5952,5957,5961,5965,5970,5974,5978,5982],{"type":41,"tag":685,"props":5885,"children":5886},{"style":702},[5887],{"type":47,"value":5888},"  await",{"type":41,"tag":685,"props":5890,"children":5891},{"style":708},[5892],{"type":47,"value":5816},{"type":41,"tag":685,"props":5894,"children":5895},{"style":719},[5896],{"type":47,"value":184},{"type":41,"tag":685,"props":5898,"children":5899},{"style":708},[5900],{"type":47,"value":1455},{"type":41,"tag":685,"props":5902,"children":5903},{"style":719},[5904],{"type":47,"value":184},{"type":41,"tag":685,"props":5906,"children":5907},{"style":708},[5908],{"type":47,"value":5909},"Post",{"type":41,"tag":685,"props":5911,"children":5912},{"style":719},[5913],{"type":47,"value":184},{"type":41,"tag":685,"props":5915,"children":5916},{"style":892},[5917],{"type":47,"value":1473},{"type":41,"tag":685,"props":5919,"children":5920},{"style":829},[5921],{"type":47,"value":915},{"type":41,"tag":685,"props":5923,"children":5924},{"style":719},[5925],{"type":47,"value":1482},{"type":41,"tag":685,"props":5927,"children":5928},{"style":829},[5929],{"type":47,"value":5930}," userId",{"type":41,"tag":685,"props":5932,"children":5933},{"style":719},[5934],{"type":47,"value":836},{"type":41,"tag":685,"props":5936,"children":5937},{"style":708},[5938],{"type":47,"value":4251},{"type":41,"tag":685,"props":5940,"children":5941},{"style":719},[5942],{"type":47,"value":184},{"type":41,"tag":685,"props":5944,"children":5945},{"style":708},[5946],{"type":47,"value":5947},"id",{"type":41,"tag":685,"props":5949,"children":5950},{"style":719},[5951],{"type":47,"value":1509},{"type":41,"tag":685,"props":5953,"children":5954},{"style":829},[5955],{"type":47,"value":5956}," title",{"type":41,"tag":685,"props":5958,"children":5959},{"style":719},[5960],{"type":47,"value":836},{"type":41,"tag":685,"props":5962,"children":5963},{"style":719},[5964],{"type":47,"value":722},{"type":41,"tag":685,"props":5966,"children":5967},{"style":725},[5968],{"type":47,"value":5969},"hello",{"type":41,"tag":685,"props":5971,"children":5972},{"style":719},[5973],{"type":47,"value":732},{"type":41,"tag":685,"props":5975,"children":5976},{"style":719},[5977],{"type":47,"value":765},{"type":41,"tag":685,"props":5979,"children":5980},{"style":829},[5981],{"type":47,"value":996},{"type":41,"tag":685,"props":5983,"children":5984},{"style":719},[5985],{"type":47,"value":737},{"type":41,"tag":685,"props":5987,"children":5988},{"class":687,"line":790},[5989],{"type":41,"tag":685,"props":5990,"children":5991},{"style":692},[5992],{"type":47,"value":5993},"  \u002F\u002F If either call throws, both inserts roll back.\n",{"type":41,"tag":685,"props":5995,"children":5996},{"class":687,"line":857},[5997,6001,6005],{"type":41,"tag":685,"props":5998,"children":5999},{"style":719},[6000],{"type":47,"value":991},{"type":41,"tag":685,"props":6002,"children":6003},{"style":708},[6004],{"type":47,"value":996},{"type":41,"tag":685,"props":6006,"children":6007},{"style":719},[6008],{"type":47,"value":737},{"type":41,"tag":63,"props":6010,"children":6011},{},[6012,6014,6019,6021,6027],{"type":47,"value":6013},"The callback returns whatever you return from it — the transaction wrapper passes it through. The ",{"type":41,"tag":50,"props":6015,"children":6017},{"className":6016},[],[6018],{"type":47,"value":5679},{"type":47,"value":6020}," object exposes ",{"type":41,"tag":50,"props":6022,"children":6024},{"className":6023},[],[6025],{"type":47,"value":6026},"execute(plan)",{"type":47,"value":6028}," for SQL-builder plans inside the transaction.",{"type":41,"tag":92,"props":6030,"children":6032},{"id":6031},"workflow-switch-between-postgres-sqlite-and-mongo",[6033],{"type":47,"value":6034},"Workflow — Switch between Postgres, SQLite, and Mongo",{"type":41,"tag":63,"props":6036,"children":6037},{},[6038,6040,6045,6046,6052,6053,6059,6060,6066,6068,6073,6075,6081,6083,6089,6091,6097,6099,6104,6105,6110],{"type":47,"value":6039},"The concept: the façade selection is baked into ",{"type":41,"tag":50,"props":6041,"children":6043},{"className":6042},[],[6044],{"type":47,"value":55},{"type":47,"value":2183},{"type":41,"tag":50,"props":6047,"children":6049},{"className":6048},[],[6050],{"type":47,"value":6051},"@prisma-next\u002Fpostgres",{"type":47,"value":163},{"type":41,"tag":50,"props":6054,"children":6056},{"className":6055},[],[6057],{"type":47,"value":6058},"@prisma-next\u002Fsqlite",{"type":47,"value":343},{"type":41,"tag":50,"props":6061,"children":6063},{"className":6062},[],[6064],{"type":47,"value":6065},"@prisma-next\u002Fmongo",{"type":47,"value":6067},") and ",{"type":41,"tag":50,"props":6069,"children":6071},{"className":6070},[],[6072],{"type":47,"value":529},{"type":47,"value":6074}," (which ",{"type":41,"tag":50,"props":6076,"children":6078},{"className":6077},[],[6079],{"type":47,"value":6080},"defineConfig",{"type":47,"value":6082}," you import from). To switch a project's target, re-run ",{"type":41,"tag":50,"props":6084,"children":6086},{"className":6085},[],[6087],{"type":47,"value":6088},"prisma-next init",{"type":47,"value":6090}," in the same directory and pick the other target — the init flow detects the existing scaffold and prompts to reinit (",{"type":41,"tag":50,"props":6092,"children":6094},{"className":6093},[],[6095],{"type":47,"value":6096},"--force",{"type":47,"value":6098}," skips the prompt). PN re-scaffolds ",{"type":41,"tag":50,"props":6100,"children":6102},{"className":6101},[],[6103],{"type":47,"value":529},{"type":47,"value":2790},{"type":41,"tag":50,"props":6106,"children":6108},{"className":6107},[],[6109],{"type":47,"value":55},{"type":47,"value":6111}," for the new façade. The contract source needs to be re-authored for the new target's idioms (Mongo expresses nested documents; Postgres\u002FSQLite express relations).",{"type":41,"tag":63,"props":6113,"children":6114},{},[6115],{"type":47,"value":6116},"After the switch (Mongo):",{"type":41,"tag":674,"props":6118,"children":6120},{"className":676,"code":6119,"language":678,"meta":679,"style":679},"\u002F\u002F src\u002Fprisma\u002Fdb.ts (Mongo)\nimport mongo from '@prisma-next\u002Fmongo\u002Fruntime';\nimport type { Contract } from '.\u002Fcontract.d';\nimport contractJson from '.\u002Fcontract.json' with { type: 'json' };\n\nexport const db = mongo\u003CContract>({ contractJson, url: process.env['DATABASE_URL'] });\n",[6121],{"type":41,"tag":50,"props":6122,"children":6123},{"__ignoreMap":679},[6124,6132,6164,6207,6266,6273],{"type":41,"tag":685,"props":6125,"children":6126},{"class":687,"line":688},[6127],{"type":41,"tag":685,"props":6128,"children":6129},{"style":692},[6130],{"type":47,"value":6131},"\u002F\u002F src\u002Fprisma\u002Fdb.ts (Mongo)\n",{"type":41,"tag":685,"props":6133,"children":6134},{"class":687,"line":698},[6135,6139,6144,6148,6152,6156,6160],{"type":41,"tag":685,"props":6136,"children":6137},{"style":702},[6138],{"type":47,"value":705},{"type":41,"tag":685,"props":6140,"children":6141},{"style":708},[6142],{"type":47,"value":6143}," mongo ",{"type":41,"tag":685,"props":6145,"children":6146},{"style":702},[6147],{"type":47,"value":716},{"type":41,"tag":685,"props":6149,"children":6150},{"style":719},[6151],{"type":47,"value":722},{"type":41,"tag":685,"props":6153,"children":6154},{"style":725},[6155],{"type":47,"value":349},{"type":41,"tag":685,"props":6157,"children":6158},{"style":719},[6159],{"type":47,"value":732},{"type":41,"tag":685,"props":6161,"children":6162},{"style":719},[6163],{"type":47,"value":737},{"type":41,"tag":685,"props":6165,"children":6166},{"class":687,"line":740},[6167,6171,6175,6179,6183,6187,6191,6195,6199,6203],{"type":41,"tag":685,"props":6168,"children":6169},{"style":702},[6170],{"type":47,"value":705},{"type":41,"tag":685,"props":6172,"children":6173},{"style":702},[6174],{"type":47,"value":750},{"type":41,"tag":685,"props":6176,"children":6177},{"style":719},[6178],{"type":47,"value":755},{"type":41,"tag":685,"props":6180,"children":6181},{"style":708},[6182],{"type":47,"value":760},{"type":41,"tag":685,"props":6184,"children":6185},{"style":719},[6186],{"type":47,"value":765},{"type":41,"tag":685,"props":6188,"children":6189},{"style":702},[6190],{"type":47,"value":770},{"type":41,"tag":685,"props":6192,"children":6193},{"style":719},[6194],{"type":47,"value":722},{"type":41,"tag":685,"props":6196,"children":6197},{"style":725},[6198],{"type":47,"value":779},{"type":41,"tag":685,"props":6200,"children":6201},{"style":719},[6202],{"type":47,"value":732},{"type":41,"tag":685,"props":6204,"children":6205},{"style":719},[6206],{"type":47,"value":737},{"type":41,"tag":685,"props":6208,"children":6209},{"class":687,"line":790},[6210,6214,6218,6222,6226,6230,6234,6238,6242,6246,6250,6254,6258,6262],{"type":41,"tag":685,"props":6211,"children":6212},{"style":702},[6213],{"type":47,"value":705},{"type":41,"tag":685,"props":6215,"children":6216},{"style":708},[6217],{"type":47,"value":800},{"type":41,"tag":685,"props":6219,"children":6220},{"style":702},[6221],{"type":47,"value":716},{"type":41,"tag":685,"props":6223,"children":6224},{"style":719},[6225],{"type":47,"value":722},{"type":41,"tag":685,"props":6227,"children":6228},{"style":725},[6229],{"type":47,"value":813},{"type":41,"tag":685,"props":6231,"children":6232},{"style":719},[6233],{"type":47,"value":732},{"type":41,"tag":685,"props":6235,"children":6236},{"style":702},[6237],{"type":47,"value":822},{"type":41,"tag":685,"props":6239,"children":6240},{"style":719},[6241],{"type":47,"value":755},{"type":41,"tag":685,"props":6243,"children":6244},{"style":829},[6245],{"type":47,"value":750},{"type":41,"tag":685,"props":6247,"children":6248},{"style":719},[6249],{"type":47,"value":836},{"type":41,"tag":685,"props":6251,"children":6252},{"style":719},[6253],{"type":47,"value":722},{"type":41,"tag":685,"props":6255,"children":6256},{"style":725},[6257],{"type":47,"value":845},{"type":41,"tag":685,"props":6259,"children":6260},{"style":719},[6261],{"type":47,"value":732},{"type":41,"tag":685,"props":6263,"children":6264},{"style":719},[6265],{"type":47,"value":854},{"type":41,"tag":685,"props":6267,"children":6268},{"class":687,"line":857},[6269],{"type":41,"tag":685,"props":6270,"children":6271},{"emptyLinePlaceholder":861},[6272],{"type":47,"value":864},{"type":41,"tag":685,"props":6274,"children":6275},{"class":687,"line":867},[6276,6280,6284,6288,6292,6297,6301,6305,6309,6313,6317,6321,6325,6329,6333,6337,6341,6345,6349,6353,6357,6361,6365,6369],{"type":41,"tag":685,"props":6277,"children":6278},{"style":702},[6279],{"type":47,"value":873},{"type":41,"tag":685,"props":6281,"children":6282},{"style":876},[6283],{"type":47,"value":879},{"type":41,"tag":685,"props":6285,"children":6286},{"style":708},[6287],{"type":47,"value":884},{"type":41,"tag":685,"props":6289,"children":6290},{"style":719},[6291],{"type":47,"value":889},{"type":41,"tag":685,"props":6293,"children":6294},{"style":892},[6295],{"type":47,"value":6296}," mongo",{"type":41,"tag":685,"props":6298,"children":6299},{"style":719},[6300],{"type":47,"value":900},{"type":41,"tag":685,"props":6302,"children":6303},{"style":903},[6304],{"type":47,"value":365},{"type":41,"tag":685,"props":6306,"children":6307},{"style":719},[6308],{"type":47,"value":910},{"type":41,"tag":685,"props":6310,"children":6311},{"style":708},[6312],{"type":47,"value":915},{"type":41,"tag":685,"props":6314,"children":6315},{"style":719},[6316],{"type":47,"value":1482},{"type":41,"tag":685,"props":6318,"children":6319},{"style":708},[6320],{"type":47,"value":1921},{"type":41,"tag":685,"props":6322,"children":6323},{"style":719},[6324],{"type":47,"value":1509},{"type":41,"tag":685,"props":6326,"children":6327},{"style":829},[6328],{"type":47,"value":1930},{"type":41,"tag":685,"props":6330,"children":6331},{"style":719},[6332],{"type":47,"value":836},{"type":41,"tag":685,"props":6334,"children":6335},{"style":708},[6336],{"type":47,"value":952},{"type":41,"tag":685,"props":6338,"children":6339},{"style":719},[6340],{"type":47,"value":184},{"type":41,"tag":685,"props":6342,"children":6343},{"style":708},[6344],{"type":47,"value":961},{"type":41,"tag":685,"props":6346,"children":6347},{"style":719},[6348],{"type":47,"value":732},{"type":41,"tag":685,"props":6350,"children":6351},{"style":725},[6352],{"type":47,"value":561},{"type":41,"tag":685,"props":6354,"children":6355},{"style":719},[6356],{"type":47,"value":732},{"type":41,"tag":685,"props":6358,"children":6359},{"style":708},[6360],{"type":47,"value":5078},{"type":41,"tag":685,"props":6362,"children":6363},{"style":719},[6364],{"type":47,"value":991},{"type":41,"tag":685,"props":6366,"children":6367},{"style":708},[6368],{"type":47,"value":996},{"type":41,"tag":685,"props":6370,"children":6371},{"style":719},[6372],{"type":47,"value":737},{"type":41,"tag":63,"props":6374,"children":6375},{},[6376],{"type":47,"value":6377},"SQLite:",{"type":41,"tag":674,"props":6379,"children":6381},{"className":676,"code":6380,"language":678,"meta":679,"style":679},"\u002F\u002F src\u002Fprisma\u002Fdb.ts (SQLite)\nimport sqlite from '@prisma-next\u002Fsqlite\u002Fruntime';\nimport type { Contract } from '.\u002Fcontract.d';\nimport contractJson from '.\u002Fcontract.json' with { type: 'json' };\n\nexport const db = sqlite\u003CContract>({ contractJson, path: 'app.db' });\n",[6382],{"type":41,"tag":50,"props":6383,"children":6384},{"__ignoreMap":679},[6385,6393,6425,6468,6527,6534],{"type":41,"tag":685,"props":6386,"children":6387},{"class":687,"line":688},[6388],{"type":41,"tag":685,"props":6389,"children":6390},{"style":692},[6391],{"type":47,"value":6392},"\u002F\u002F src\u002Fprisma\u002Fdb.ts (SQLite)\n",{"type":41,"tag":685,"props":6394,"children":6395},{"class":687,"line":698},[6396,6400,6405,6409,6413,6417,6421],{"type":41,"tag":685,"props":6397,"children":6398},{"style":702},[6399],{"type":47,"value":705},{"type":41,"tag":685,"props":6401,"children":6402},{"style":708},[6403],{"type":47,"value":6404}," sqlite ",{"type":41,"tag":685,"props":6406,"children":6407},{"style":702},[6408],{"type":47,"value":716},{"type":41,"tag":685,"props":6410,"children":6411},{"style":719},[6412],{"type":47,"value":722},{"type":41,"tag":685,"props":6414,"children":6415},{"style":725},[6416],{"type":47,"value":341},{"type":41,"tag":685,"props":6418,"children":6419},{"style":719},[6420],{"type":47,"value":732},{"type":41,"tag":685,"props":6422,"children":6423},{"style":719},[6424],{"type":47,"value":737},{"type":41,"tag":685,"props":6426,"children":6427},{"class":687,"line":740},[6428,6432,6436,6440,6444,6448,6452,6456,6460,6464],{"type":41,"tag":685,"props":6429,"children":6430},{"style":702},[6431],{"type":47,"value":705},{"type":41,"tag":685,"props":6433,"children":6434},{"style":702},[6435],{"type":47,"value":750},{"type":41,"tag":685,"props":6437,"children":6438},{"style":719},[6439],{"type":47,"value":755},{"type":41,"tag":685,"props":6441,"children":6442},{"style":708},[6443],{"type":47,"value":760},{"type":41,"tag":685,"props":6445,"children":6446},{"style":719},[6447],{"type":47,"value":765},{"type":41,"tag":685,"props":6449,"children":6450},{"style":702},[6451],{"type":47,"value":770},{"type":41,"tag":685,"props":6453,"children":6454},{"style":719},[6455],{"type":47,"value":722},{"type":41,"tag":685,"props":6457,"children":6458},{"style":725},[6459],{"type":47,"value":779},{"type":41,"tag":685,"props":6461,"children":6462},{"style":719},[6463],{"type":47,"value":732},{"type":41,"tag":685,"props":6465,"children":6466},{"style":719},[6467],{"type":47,"value":737},{"type":41,"tag":685,"props":6469,"children":6470},{"class":687,"line":790},[6471,6475,6479,6483,6487,6491,6495,6499,6503,6507,6511,6515,6519,6523],{"type":41,"tag":685,"props":6472,"children":6473},{"style":702},[6474],{"type":47,"value":705},{"type":41,"tag":685,"props":6476,"children":6477},{"style":708},[6478],{"type":47,"value":800},{"type":41,"tag":685,"props":6480,"children":6481},{"style":702},[6482],{"type":47,"value":716},{"type":41,"tag":685,"props":6484,"children":6485},{"style":719},[6486],{"type":47,"value":722},{"type":41,"tag":685,"props":6488,"children":6489},{"style":725},[6490],{"type":47,"value":813},{"type":41,"tag":685,"props":6492,"children":6493},{"style":719},[6494],{"type":47,"value":732},{"type":41,"tag":685,"props":6496,"children":6497},{"style":702},[6498],{"type":47,"value":822},{"type":41,"tag":685,"props":6500,"children":6501},{"style":719},[6502],{"type":47,"value":755},{"type":41,"tag":685,"props":6504,"children":6505},{"style":829},[6506],{"type":47,"value":750},{"type":41,"tag":685,"props":6508,"children":6509},{"style":719},[6510],{"type":47,"value":836},{"type":41,"tag":685,"props":6512,"children":6513},{"style":719},[6514],{"type":47,"value":722},{"type":41,"tag":685,"props":6516,"children":6517},{"style":725},[6518],{"type":47,"value":845},{"type":41,"tag":685,"props":6520,"children":6521},{"style":719},[6522],{"type":47,"value":732},{"type":41,"tag":685,"props":6524,"children":6525},{"style":719},[6526],{"type":47,"value":854},{"type":41,"tag":685,"props":6528,"children":6529},{"class":687,"line":857},[6530],{"type":41,"tag":685,"props":6531,"children":6532},{"emptyLinePlaceholder":861},[6533],{"type":47,"value":864},{"type":41,"tag":685,"props":6535,"children":6536},{"class":687,"line":867},[6537,6541,6545,6549,6553,6558,6562,6566,6570,6574,6578,6582,6586,6591,6595,6599,6604,6608,6612,6616],{"type":41,"tag":685,"props":6538,"children":6539},{"style":702},[6540],{"type":47,"value":873},{"type":41,"tag":685,"props":6542,"children":6543},{"style":876},[6544],{"type":47,"value":879},{"type":41,"tag":685,"props":6546,"children":6547},{"style":708},[6548],{"type":47,"value":884},{"type":41,"tag":685,"props":6550,"children":6551},{"style":719},[6552],{"type":47,"value":889},{"type":41,"tag":685,"props":6554,"children":6555},{"style":892},[6556],{"type":47,"value":6557}," sqlite",{"type":41,"tag":685,"props":6559,"children":6560},{"style":719},[6561],{"type":47,"value":900},{"type":41,"tag":685,"props":6563,"children":6564},{"style":903},[6565],{"type":47,"value":365},{"type":41,"tag":685,"props":6567,"children":6568},{"style":719},[6569],{"type":47,"value":910},{"type":41,"tag":685,"props":6571,"children":6572},{"style":708},[6573],{"type":47,"value":915},{"type":41,"tag":685,"props":6575,"children":6576},{"style":719},[6577],{"type":47,"value":1482},{"type":41,"tag":685,"props":6579,"children":6580},{"style":708},[6581],{"type":47,"value":1921},{"type":41,"tag":685,"props":6583,"children":6584},{"style":719},[6585],{"type":47,"value":1509},{"type":41,"tag":685,"props":6587,"children":6588},{"style":829},[6589],{"type":47,"value":6590}," path",{"type":41,"tag":685,"props":6592,"children":6593},{"style":719},[6594],{"type":47,"value":836},{"type":41,"tag":685,"props":6596,"children":6597},{"style":719},[6598],{"type":47,"value":722},{"type":41,"tag":685,"props":6600,"children":6601},{"style":725},[6602],{"type":47,"value":6603},"app.db",{"type":41,"tag":685,"props":6605,"children":6606},{"style":719},[6607],{"type":47,"value":732},{"type":41,"tag":685,"props":6609,"children":6610},{"style":719},[6611],{"type":47,"value":765},{"type":41,"tag":685,"props":6613,"children":6614},{"style":708},[6615],{"type":47,"value":996},{"type":41,"tag":685,"props":6617,"children":6618},{"style":719},[6619],{"type":47,"value":737},{"type":41,"tag":63,"props":6621,"children":6622},{},[6623,6629,6631,6637,6639,6644,6645,6650,6651,6656,6657,6662,6663,6668,6670,6675,6676,6681,6682,6687,6689,6694,6696,6701],{"type":41,"tag":50,"props":6624,"children":6626},{"className":6625},[],[6627],{"type":47,"value":6628},"path",{"type":47,"value":6630}," is optional at construct time (you can call ",{"type":41,"tag":50,"props":6632,"children":6634},{"className":6633},[],[6635],{"type":47,"value":6636},"db.connect({ path })",{"type":47,"value":6638}," later); omit it and the façade still returns a client. The SQLite façade exposes the same ",{"type":41,"tag":50,"props":6640,"children":6642},{"className":6641},[],[6643],{"type":47,"value":468},{"type":47,"value":163},{"type":41,"tag":50,"props":6646,"children":6648},{"className":6647},[],[6649],{"type":47,"value":475},{"type":47,"value":163},{"type":41,"tag":50,"props":6652,"children":6654},{"className":6653},[],[6655],{"type":47,"value":140},{"type":47,"value":163},{"type":41,"tag":50,"props":6658,"children":6660},{"className":6659},[],[6661],{"type":47,"value":161},{"type":47,"value":2872},{"type":41,"tag":50,"props":6664,"children":6666},{"className":6665},[],[6667],{"type":47,"value":1710},{"type":47,"value":6669}," surfaces as Postgres. The Mongo façade shares ",{"type":41,"tag":50,"props":6671,"children":6673},{"className":6672},[],[6674],{"type":47,"value":475},{"type":47,"value":163},{"type":41,"tag":50,"props":6677,"children":6679},{"className":6678},[],[6680],{"type":47,"value":161},{"type":47,"value":2872},{"type":41,"tag":50,"props":6683,"children":6685},{"className":6684},[],[6686],{"type":47,"value":1710},{"type":47,"value":6688}," but has no ",{"type":41,"tag":50,"props":6690,"children":6692},{"className":6691},[],[6693],{"type":47,"value":468},{"type":47,"value":6695}," and no ",{"type":41,"tag":50,"props":6697,"children":6699},{"className":6698},[],[6700],{"type":47,"value":140},{"type":47,"value":184},{"type":41,"tag":63,"props":6703,"children":6704},{},[6705,6706,6711,6712,6717,6719,6725],{"type":47,"value":5155},{"type":41,"tag":50,"props":6707,"children":6709},{"className":6708},[],[6710],{"type":47,"value":468},{"type":47,"value":226},{"type":41,"tag":50,"props":6713,"children":6715},{"className":6714},[],[6716],{"type":47,"value":475},{"type":47,"value":6718}," surfaces stay the same in name; the operators each surface exposes are target-shaped (Mongo has no ",{"type":41,"tag":50,"props":6720,"children":6722},{"className":6721},[],[6723],{"type":47,"value":6724},"JOIN",{"type":47,"value":171},{"type":41,"tag":92,"props":6727,"children":6729},{"id":6728},"workflow-build-system-dev-server-integration",[6730],{"type":47,"value":6731},"Workflow — Build-system \u002F dev-server integration",{"type":41,"tag":63,"props":6733,"children":6734},{},[6735,6737,6743,6745,6750],{"type":47,"value":6736},"If you want contract artefacts to re-emit automatically while the dev server is running (instead of running ",{"type":41,"tag":50,"props":6738,"children":6740},{"className":6739},[],[6741],{"type":47,"value":6742},"prisma-next contract emit",{"type":47,"value":6744}," by hand each time the contract source changes), reach for the build-tool plugin from ",{"type":41,"tag":50,"props":6746,"children":6748},{"className":6747},[],[6749],{"type":47,"value":271},{"type":47,"value":836},{"type":41,"tag":99,"props":6752,"children":6753},{},[6754,6786],{"type":41,"tag":103,"props":6755,"children":6756},{},[6757,6762,6764,6770,6772,6778,6779,6785],{"type":41,"tag":67,"props":6758,"children":6759},{},[6760],{"type":47,"value":6761},"Vite",{"type":47,"value":6763},": install ",{"type":41,"tag":50,"props":6765,"children":6767},{"className":6766},[],[6768],{"type":47,"value":6769},"@prisma-next\u002Fvite-plugin-contract-emit",{"type":47,"value":6771}," and register ",{"type":41,"tag":50,"props":6773,"children":6775},{"className":6774},[],[6776],{"type":47,"value":6777},"prismaVitePlugin('prisma-next.config.ts')",{"type":47,"value":2423},{"type":41,"tag":50,"props":6780,"children":6782},{"className":6781},[],[6783],{"type":47,"value":6784},"vite.config.ts",{"type":47,"value":184},{"type":41,"tag":103,"props":6787,"children":6788},{},[6789,6794,6796,6802,6804,6809,6811,6816],{"type":41,"tag":67,"props":6790,"children":6791},{},[6792],{"type":47,"value":6793},"Next.js, Webpack, esbuild, Rollup, Turbopack",{"type":47,"value":6795},": no first-party plugin yet — the workaround is a ",{"type":41,"tag":50,"props":6797,"children":6799},{"className":6798},[],[6800],{"type":47,"value":6801},"prebuild",{"type":47,"value":6803}," script that runs ",{"type":41,"tag":50,"props":6805,"children":6807},{"className":6806},[],[6808],{"type":47,"value":6742},{"type":47,"value":6810},". See ",{"type":41,"tag":50,"props":6812,"children":6814},{"className":6813},[],[6815],{"type":47,"value":271},{"type":47,"value":6817}," for the walkthrough.",{"type":41,"tag":63,"props":6819,"children":6820},{},[6821,6823,6828,6830,6835,6837,6842],{"type":47,"value":6822},"The runtime side (this skill) is the same regardless: ",{"type":41,"tag":50,"props":6824,"children":6826},{"className":6825},[],[6827],{"type":47,"value":55},{"type":47,"value":6829}," reads ",{"type":41,"tag":50,"props":6831,"children":6833},{"className":6832},[],[6834],{"type":47,"value":357},{"type":47,"value":6836}," + ",{"type":41,"tag":50,"props":6838,"children":6840},{"className":6839},[],[6841],{"type":47,"value":373},{"type":47,"value":6843}," from disk. The build-system plugin's job is to keep those files current during development.",{"type":41,"tag":92,"props":6845,"children":6847},{"id":6846},"common-pitfalls",[6848],{"type":47,"value":6849},"Common Pitfalls",{"type":41,"tag":6851,"props":6852,"children":6853},"ol",{},[6854,6882,6914,6931,6941,6982,7052,7062],{"type":41,"tag":103,"props":6855,"children":6856},{},[6857,6874,6876,6881],{"type":41,"tag":67,"props":6858,"children":6859},{},[6860,6862,6867,6868,6873],{"type":47,"value":6861},"Hardcoding ",{"type":41,"tag":50,"props":6863,"children":6865},{"className":6864},[],[6866],{"type":47,"value":561},{"type":47,"value":2423},{"type":41,"tag":50,"props":6869,"children":6871},{"className":6870},[],[6872],{"type":47,"value":529},{"type":47,"value":184},{"type":47,"value":6875}," Leaks credentials; bypasses per-environment overrides. Use ",{"type":41,"tag":50,"props":6877,"children":6879},{"className":6878},[],[6880],{"type":47,"value":537},{"type":47,"value":184},{"type":41,"tag":103,"props":6883,"children":6884},{},[6885,6897,6898,6904,6906,6912],{"type":41,"tag":67,"props":6886,"children":6887},{},[6888,6890,6895],{"type":47,"value":6889},"Omitting the ",{"type":41,"tag":50,"props":6891,"children":6893},{"className":6892},[],[6894],{"type":47,"value":1079},{"type":47,"value":6896}," type parameter",{"type":47,"value":2423},{"type":41,"tag":50,"props":6899,"children":6901},{"className":6900},[],[6902],{"type":47,"value":6903},"postgres\u003CContract>(...)",{"type":47,"value":6905},". Without it, static surfaces collapse to a generic shape and you lose autocomplete for models. There is no second type parameter — the older two-param signature (",{"type":41,"tag":50,"props":6907,"children":6909},{"className":6908},[],[6910],{"type":47,"value":6911},"postgres\u003CContract, TypeMaps>",{"type":47,"value":6913},") is gone.",{"type":41,"tag":103,"props":6915,"children":6916},{},[6917,6929],{"type":41,"tag":67,"props":6918,"children":6919},{},[6920,6922,6927],{"type":47,"value":6921},"Forgetting ",{"type":41,"tag":50,"props":6923,"children":6925},{"className":6924},[],[6926],{"type":47,"value":1109},{"type":47,"value":6928}," on the contract import.",{"type":47,"value":6930}," Required by Node's ESM JSON-import-attribute spec.",{"type":41,"tag":103,"props":6932,"children":6933},{},[6934,6939],{"type":41,"tag":67,"props":6935,"children":6936},{},[6937],{"type":47,"value":6938},"Middleware order matters.",{"type":47,"value":6940}," Outermost wraps. Put telemetry first if you want it to capture inner-middleware errors.",{"type":41,"tag":103,"props":6942,"children":6943},{},[6944,6949,6950,6956,6957,6961,6963,6968,6970,6975,6977,6981],{"type":41,"tag":67,"props":6945,"children":6946},{},[6947],{"type":47,"value":6948},"Importing middleware from a non-existent façade subpath.",{"type":47,"value":595},{"type":41,"tag":50,"props":6951,"children":6953},{"className":6952},[],[6954],{"type":47,"value":6955},"@prisma-next\u002Fpostgres\u002Fmiddleware",{"type":47,"value":3069},{"type":41,"tag":178,"props":6958,"children":6959},{},[6960],{"type":47,"value":3074},{"type":47,"value":6962}," exist. Telemetry comes from ",{"type":41,"tag":50,"props":6964,"children":6966},{"className":6965},[],[6967],{"type":47,"value":3210},{"type":47,"value":6969},"; lints \u002F budgets come from ",{"type":41,"tag":50,"props":6971,"children":6973},{"className":6972},[],[6974],{"type":47,"value":3640},{"type":47,"value":6976}," today (see ",{"type":41,"tag":178,"props":6978,"children":6979},{},[6980],{"type":47,"value":1194},{"type":47,"value":171},{"type":41,"tag":103,"props":6983,"children":6984},{},[6985,6990,6992,6997,6999,7005,7006,7012,7014,7020,7022,7028,7030,7036,7037,7043,7044,7050],{"type":41,"tag":67,"props":6986,"children":6987},{},[6988],{"type":47,"value":6989},"Confabulating lint \u002F budget option names.",{"type":47,"value":6991}," Lints take ",{"type":41,"tag":50,"props":6993,"children":6995},{"className":6994},[],[6996],{"type":47,"value":4440},{"type":47,"value":6998}," (with the five keys above), not ",{"type":41,"tag":50,"props":7000,"children":7002},{"className":7001},[],[7003],{"type":47,"value":7004},"requireWhere",{"type":47,"value":226},{"type":41,"tag":50,"props":7007,"children":7009},{"className":7008},[],[7010],{"type":47,"value":7011},"maxRowsWithoutLimit",{"type":47,"value":7013},". Budgets use ",{"type":41,"tag":50,"props":7015,"children":7017},{"className":7016},[],[7018],{"type":47,"value":7019},"maxLatencyMs",{"type":47,"value":7021}," (not ",{"type":41,"tag":50,"props":7023,"children":7025},{"className":7024},[],[7026],{"type":47,"value":7027},"maxDurationMs",{"type":47,"value":7029},") plus ",{"type":41,"tag":50,"props":7031,"children":7033},{"className":7032},[],[7034],{"type":47,"value":7035},"maxRows",{"type":47,"value":226},{"type":41,"tag":50,"props":7038,"children":7040},{"className":7039},[],[7041],{"type":47,"value":7042},"defaultTableRows",{"type":47,"value":226},{"type":41,"tag":50,"props":7045,"children":7047},{"className":7046},[],[7048],{"type":47,"value":7049},"tableRows",{"type":47,"value":7051},". When in doubt, read the source.",{"type":41,"tag":103,"props":7053,"children":7054},{},[7055,7060],{"type":41,"tag":67,"props":7056,"children":7057},{},[7058],{"type":47,"value":7059},"Switching targets without re-emitting.",{"type":47,"value":7061}," The contract artefacts are target-shaped; emit after the target change.",{"type":41,"tag":103,"props":7063,"children":7064},{},[7065,7070,7072,7077,7079,7084,7086,7092,7094,7099,7101,7106],{"type":41,"tag":67,"props":7066,"children":7067},{},[7068],{"type":47,"value":7069},"Script hangs after queries finish on Postgres.",{"type":47,"value":7071}," The ",{"type":41,"tag":50,"props":7073,"children":7075},{"className":7074},[],[7076],{"type":47,"value":1311},{"type":47,"value":7078}," keeps Node's event loop alive. Solution: ",{"type":41,"tag":50,"props":7080,"children":7082},{"className":7081},[],[7083],{"type":47,"value":1319},{"type":47,"value":7085}," before the script returns, or ",{"type":41,"tag":50,"props":7087,"children":7089},{"className":7088},[],[7090],{"type":47,"value":7091},"await using db = postgres\u003CContract>(...)",{"type":47,"value":7093}," at the top of a script module. Do not put ",{"type":41,"tag":50,"props":7095,"children":7097},{"className":7096},[],[7098],{"type":47,"value":2097},{"type":47,"value":7100}," inside a request handler — it's block-scoped and would close the pool after every request. The right server pattern is a module-level singleton in ",{"type":41,"tag":50,"props":7102,"children":7104},{"className":7103},[],[7105],{"type":47,"value":55},{"type":47,"value":7107}," that lives for the process lifetime.",{"type":41,"tag":92,"props":7109,"children":7111},{"id":7110},"what-prisma-next-doesnt-do-yet",[7112],{"type":47,"value":1194},{"type":41,"tag":99,"props":7114,"children":7115},{},[7116,7226,7250,7307],{"type":41,"tag":103,"props":7117,"children":7118},{},[7119,7129,7131,7137,7139,7145,7147,7153,7155,7161,7163,7169,7171,7177,7179,7185,7187,7193,7194,7200,7201,7206,7207,7212,7213,7218,7220,7225],{"type":41,"tag":67,"props":7120,"children":7121},{},[7122,7127],{"type":41,"tag":50,"props":7123,"children":7125},{"className":7124},[],[7126],{"type":47,"value":6955},{"type":47,"value":7128}," subpath.",{"type":47,"value":7130}," The postgres façade re-exports the runtime factory (",{"type":41,"tag":50,"props":7132,"children":7134},{"className":7133},[],[7135],{"type":47,"value":7136},".\u002Fruntime",{"type":47,"value":7138},"), config (",{"type":41,"tag":50,"props":7140,"children":7142},{"className":7141},[],[7143],{"type":47,"value":7144},".\u002Fconfig",{"type":47,"value":7146},"), contract-builder (",{"type":41,"tag":50,"props":7148,"children":7150},{"className":7149},[],[7151],{"type":47,"value":7152},".\u002Fcontract-builder",{"type":47,"value":7154},"), control (",{"type":41,"tag":50,"props":7156,"children":7158},{"className":7157},[],[7159],{"type":47,"value":7160},".\u002Fcontrol",{"type":47,"value":7162},"), family (",{"type":41,"tag":50,"props":7164,"children":7166},{"className":7165},[],[7167],{"type":47,"value":7168},".\u002Ffamily",{"type":47,"value":7170},"), target (",{"type":41,"tag":50,"props":7172,"children":7174},{"className":7173},[],[7175],{"type":47,"value":7176},".\u002Ftarget",{"type":47,"value":7178},"), and serverless (",{"type":41,"tag":50,"props":7180,"children":7182},{"className":7181},[],[7183],{"type":47,"value":7184},".\u002Fserverless",{"type":47,"value":7186},") — but not middleware. Today's workaround: import ",{"type":41,"tag":50,"props":7188,"children":7190},{"className":7189},[],[7191],{"type":47,"value":7192},"lints",{"type":47,"value":2790},{"type":41,"tag":50,"props":7195,"children":7197},{"className":7196},[],[7198],{"type":47,"value":7199},"budgets",{"type":47,"value":1351},{"type":41,"tag":50,"props":7202,"children":7204},{"className":7203},[],[7205],{"type":47,"value":3640},{"type":47,"value":2872},{"type":41,"tag":50,"props":7208,"children":7210},{"className":7209},[],[7211],{"type":47,"value":3563},{"type":47,"value":1351},{"type":41,"tag":50,"props":7214,"children":7216},{"className":7215},[],[7217],{"type":47,"value":3210},{"type":47,"value":7219},". File additional gaps you hit via ",{"type":41,"tag":50,"props":7221,"children":7223},{"className":7222},[],[7224],{"type":47,"value":295},{"type":47,"value":184},{"type":41,"tag":103,"props":7227,"children":7228},{},[7229,7234,7236,7241,7243,7248],{"type":41,"tag":67,"props":7230,"children":7231},{},[7232],{"type":47,"value":7233},"Multi-database routing \u002F read replicas.",{"type":47,"value":7235}," Prisma Next doesn't ship a built-in primary\u002Freplica router or shard-aware client. Workaround: configure separate ",{"type":41,"tag":50,"props":7237,"children":7239},{"className":7238},[],[7240],{"type":47,"value":55},{"type":47,"value":7242}," instances per data store and call the right one in your application code. If you need first-class multi-database routing, file a feature request via the ",{"type":41,"tag":50,"props":7244,"children":7246},{"className":7245},[],[7247],{"type":47,"value":295},{"type":47,"value":7249}," skill.",{"type":41,"tag":103,"props":7251,"children":7252},{},[7253,7258,7259,7264,7265,7270,7272,7277,7279,7285,7287,7292,7294,7299,7301,7306],{"type":41,"tag":67,"props":7254,"children":7255},{},[7256],{"type":47,"value":7257},"Connection pooling as a first-class config field.",{"type":47,"value":595},{"type":41,"tag":50,"props":7260,"children":7262},{"className":7261},[],[7263],{"type":47,"value":4754},{"type":47,"value":2790},{"type":41,"tag":50,"props":7266,"children":7268},{"className":7267},[],[7269],{"type":47,"value":4761},{"type":47,"value":7271}," are wired through, but the rest of ",{"type":41,"tag":50,"props":7273,"children":7275},{"className":7274},[],[7276],{"type":47,"value":1311},{"type":47,"value":7278},"'s tuning surface (max connections, ",{"type":41,"tag":50,"props":7280,"children":7282},{"className":7281},[],[7283],{"type":47,"value":7284},"allowExitOnIdle",{"type":47,"value":7286},", ssl options, …) is not exposed by name. Workaround: construct the ",{"type":41,"tag":50,"props":7288,"children":7290},{"className":7289},[],[7291],{"type":47,"value":1311},{"type":47,"value":7293}," yourself and pass it via ",{"type":41,"tag":50,"props":7295,"children":7297},{"className":7296},[],[7298],{"type":47,"value":3037},{"type":47,"value":7300},". If you need more pool fields surfaced on the façade, file a feature request via the ",{"type":41,"tag":50,"props":7302,"children":7304},{"className":7303},[],[7305],{"type":47,"value":295},{"type":47,"value":7249},{"type":41,"tag":103,"props":7308,"children":7309},{},[7310,7315,7317,7322,7324,7330,7332,7337],{"type":41,"tag":67,"props":7311,"children":7312},{},[7313],{"type":47,"value":7314},"Query logger middleware as a built-in.",{"type":47,"value":7316}," Prisma Next doesn't ship a \"log every query\" middleware. Workaround: write a small custom middleware that wraps each operation and logs; or use ",{"type":41,"tag":50,"props":7318,"children":7320},{"className":7319},[],[7321],{"type":47,"value":3563},{"type":47,"value":7323}," and log inside the ",{"type":41,"tag":50,"props":7325,"children":7327},{"className":7326},[],[7328],{"type":47,"value":7329},"onEvent",{"type":47,"value":7331}," callback. If you need a built-in query log, file a feature request via the ",{"type":41,"tag":50,"props":7333,"children":7335},{"className":7334},[],[7336],{"type":47,"value":295},{"type":47,"value":7249},{"type":41,"tag":92,"props":7339,"children":7341},{"id":7340},"reference-files",[7342],{"type":47,"value":7343},"Reference Files",{"type":41,"tag":63,"props":7345,"children":7346},{},[7347,7349,7355,7357,7362,7364,7370,7371,7377,7378,7384,7386,7392],{"type":47,"value":7348},"This skill is intentionally body-only; ",{"type":41,"tag":50,"props":7350,"children":7352},{"className":7351},[],[7353],{"type":47,"value":7354},"prisma-next init --help",{"type":47,"value":7356},", the ",{"type":41,"tag":50,"props":7358,"children":7360},{"className":7359},[],[7361],{"type":47,"value":6080},{"type":47,"value":7363}," factory in ",{"type":41,"tag":50,"props":7365,"children":7367},{"className":7366},[],[7368],{"type":47,"value":7369},"packages\u002F3-extensions\u002Fpostgres\u002Fsrc\u002Fconfig\u002Fdefine-config.ts",{"type":47,"value":7356},{"type":41,"tag":50,"props":7372,"children":7374},{"className":7373},[],[7375],{"type":47,"value":7376},"postgres()",{"type":47,"value":7363},{"type":41,"tag":50,"props":7379,"children":7381},{"className":7380},[],[7382],{"type":47,"value":7383},"packages\u002F3-extensions\u002Fpostgres\u002Fsrc\u002Fruntime\u002Fpostgres.ts",{"type":47,"value":7385},", and the middleware sources in ",{"type":41,"tag":50,"props":7387,"children":7389},{"className":7388},[],[7390],{"type":47,"value":7391},"packages\u002F2-sql\u002F5-runtime\u002Fsrc\u002Fmiddleware\u002F{lints,budgets}.ts",{"type":47,"value":7393}," are the authoritative surfaces for option-level detail. When in doubt, read the source.",{"type":41,"tag":92,"props":7395,"children":7397},{"id":7396},"checklist",[7398],{"type":47,"value":7399},"Checklist",{"type":41,"tag":99,"props":7401,"children":7404},{"className":7402},[7403],"contains-task-list",[7405,7463,7478,7500,7527,7536,7581,7597,7606,7637,7653,7674],{"type":41,"tag":103,"props":7406,"children":7409},{"className":7407},[7408],"task-list-item",[7410,7415,7416,7421,7423,7429,7430,7435,7436,7442,7443,7449,7451,7456,7457,7462],{"type":41,"tag":7411,"props":7412,"children":7414},"input",{"disabled":861,"type":7413},"checkbox",[],{"type":47,"value":595},{"type":41,"tag":50,"props":7417,"children":7419},{"className":7418},[],[7420],{"type":47,"value":55},{"type":47,"value":7422}," imports the runtime factory from ",{"type":41,"tag":50,"props":7424,"children":7426},{"className":7425},[],[7427],{"type":47,"value":7428},"@prisma-next\u002F\u003Ctarget>\u002Fruntime",{"type":47,"value":2183},{"type":41,"tag":50,"props":7431,"children":7433},{"className":7432},[],[7434],{"type":47,"value":4797},{"type":47,"value":163},{"type":41,"tag":50,"props":7437,"children":7439},{"className":7438},[],[7440],{"type":47,"value":7441},"sqlite",{"type":47,"value":343},{"type":41,"tag":50,"props":7444,"children":7446},{"className":7445},[],[7447],{"type":47,"value":7448},"mongo",{"type":47,"value":7450},") and the ",{"type":41,"tag":50,"props":7452,"children":7454},{"className":7453},[],[7455],{"type":47,"value":365},{"type":47,"value":367},{"type":41,"tag":50,"props":7458,"children":7460},{"className":7459},[],[7461],{"type":47,"value":779},{"type":47,"value":184},{"type":41,"tag":103,"props":7464,"children":7466},{"className":7465},[7408],[7467,7470,7471,7476],{"type":41,"tag":7411,"props":7468,"children":7469},{"disabled":861,"type":7413},[],{"type":47,"value":595},{"type":41,"tag":50,"props":7472,"children":7474},{"className":7473},[],[7475],{"type":47,"value":1109},{"type":47,"value":7477}," on the contract JSON import.",{"type":41,"tag":103,"props":7479,"children":7481},{"className":7480},[7408],[7482,7485,7486,7491,7493,7498],{"type":41,"tag":7411,"props":7483,"children":7484},{"disabled":861,"type":7413},[],{"type":47,"value":595},{"type":41,"tag":50,"props":7487,"children":7489},{"className":7488},[],[7490],{"type":47,"value":1079},{"type":47,"value":7492}," is the single type parameter on ",{"type":41,"tag":50,"props":7494,"children":7496},{"className":7495},[],[7497],{"type":47,"value":6903},{"type":47,"value":7499}," (no second parameter).",{"type":41,"tag":103,"props":7501,"children":7503},{"className":7502},[7408],[7504,7507,7508,7513,7514,7519,7521,7526],{"type":41,"tag":7411,"props":7505,"children":7506},{"disabled":861,"type":7413},[],{"type":47,"value":595},{"type":41,"tag":50,"props":7509,"children":7511},{"className":7510},[],[7512],{"type":47,"value":561},{"type":47,"value":5178},{"type":41,"tag":50,"props":7515,"children":7517},{"className":7516},[],[7518],{"type":47,"value":537},{"type":47,"value":7520},", not in ",{"type":41,"tag":50,"props":7522,"children":7524},{"className":7523},[],[7525],{"type":47,"value":529},{"type":47,"value":184},{"type":41,"tag":103,"props":7528,"children":7530},{"className":7529},[7408],[7531,7534],{"type":41,"tag":7411,"props":7532,"children":7533},{"disabled":861,"type":7413},[],{"type":47,"value":7535}," Middleware ordered intentionally (telemetry outermost typically).",{"type":41,"tag":103,"props":7537,"children":7539},{"className":7538},[7408],[7540,7543,7544,7549,7550,7555,7557,7562,7563,7568,7569,7574,7575,7580],{"type":41,"tag":7411,"props":7541,"children":7542},{"disabled":861,"type":7413},[],{"type":47,"value":595},{"type":41,"tag":50,"props":7545,"children":7547},{"className":7546},[],[7548],{"type":47,"value":7192},{"type":47,"value":226},{"type":41,"tag":50,"props":7551,"children":7553},{"className":7552},[],[7554],{"type":47,"value":7199},{"type":47,"value":7556}," use the verified option keys (",{"type":41,"tag":50,"props":7558,"children":7560},{"className":7559},[],[7561],{"type":47,"value":4440},{"type":47,"value":163},{"type":41,"tag":50,"props":7564,"children":7566},{"className":7565},[],[7567],{"type":47,"value":7019},{"type":47,"value":163},{"type":41,"tag":50,"props":7570,"children":7572},{"className":7571},[],[7573],{"type":47,"value":7035},{"type":47,"value":163},{"type":41,"tag":50,"props":7576,"children":7578},{"className":7577},[],[7579],{"type":47,"value":7049},{"type":47,"value":171},{"type":41,"tag":103,"props":7582,"children":7584},{"className":7583},[7408],[7585,7588,7590,7595],{"type":41,"tag":7411,"props":7586,"children":7587},{"disabled":861,"type":7413},[],{"type":47,"value":7589}," Per-env divergence (if any) gated by ",{"type":41,"tag":50,"props":7591,"children":7593},{"className":7592},[],[7594],{"type":47,"value":5283},{"type":47,"value":7596}," or similar.",{"type":41,"tag":103,"props":7598,"children":7600},{"className":7599},[7408],[7601,7604],{"type":41,"tag":7411,"props":7602,"children":7603},{"disabled":861,"type":7413},[],{"type":47,"value":7605}," Did NOT hardcode credentials in any committed file.",{"type":41,"tag":103,"props":7607,"children":7609},{"className":7608},[7408],[7610,7613,7615,7620,7622,7628,7630,7636],{"type":41,"tag":7411,"props":7611,"children":7612},{"disabled":861,"type":7413},[],{"type":47,"value":7614}," Did NOT confabulate a ",{"type":41,"tag":50,"props":7616,"children":7618},{"className":7617},[],[7619],{"type":47,"value":6955},{"type":47,"value":7621}," subpath, a ",{"type":41,"tag":50,"props":7623,"children":7625},{"className":7624},[],[7626],{"type":47,"value":7627},"@prisma-next\u002Fpostgres-extension-audit",{"type":47,"value":7629}," package, or a second type parameter on ",{"type":41,"tag":50,"props":7631,"children":7633},{"className":7632},[],[7634],{"type":47,"value":7635},"postgres\u003C...>",{"type":47,"value":184},{"type":41,"tag":103,"props":7638,"children":7640},{"className":7639},[7408],[7641,7644,7646,7651],{"type":41,"tag":7411,"props":7642,"children":7643},{"disabled":861,"type":7413},[],{"type":47,"value":7645}," Did NOT claim ",{"type":41,"tag":50,"props":7647,"children":7649},{"className":7648},[],[7650],{"type":47,"value":140},{"type":47,"value":7652}," exists on the Mongo façade — only Postgres and SQLite expose it.",{"type":41,"tag":103,"props":7654,"children":7656},{"className":7655},[7408],[7657,7660,7662,7666,7668,7673],{"type":41,"tag":7411,"props":7658,"children":7659},{"disabled":861,"type":7413},[],{"type":47,"value":7661}," Did NOT confabulate read-replica \u002F multi-DB \u002F extra pool config — pointed at ",{"type":41,"tag":178,"props":7663,"children":7664},{},[7665],{"type":47,"value":1194},{"type":47,"value":7667}," and routed to ",{"type":41,"tag":50,"props":7669,"children":7671},{"className":7670},[],[7672],{"type":47,"value":295},{"type":47,"value":184},{"type":41,"tag":103,"props":7675,"children":7677},{"className":7676},[7408],[7678,7681,7683,7688],{"type":41,"tag":7411,"props":7679,"children":7680},{"disabled":861,"type":7413},[],{"type":47,"value":7682}," For build-system \u002F dev-server prompts (Vite plugin, Next.js plugin, …) routed to ",{"type":41,"tag":50,"props":7684,"children":7686},{"className":7685},[],[7687],{"type":47,"value":271},{"type":47,"value":184},{"type":41,"tag":7690,"props":7691,"children":7692},"style",{},[7693],{"type":47,"value":7694},"html .light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html.light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html.dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}",{"items":7696,"total":3460},[7697,7709,7722,7734,7746,7759,7777],{"slug":7698,"name":7698,"fn":7699,"description":7700,"org":7701,"tags":7702,"stars":23,"repoUrl":24,"updatedAt":7708},"prisma-next","guide Prisma Next project setup and usage","Route a vague Prisma Next prompt to the right specific skill. Use for \"help me with Prisma Next\", \"what is Prisma Next\", \"explain Prisma Next\", \"I'm new to PN\", \"where do I start\", \"what can I do with Prisma Next\", \"what can I do next with Prisma\", \"just ran createprisma\", \"tour of Prisma Next\", \"Prisma Next overview\", and comparison questions like \"Prisma Next vs Prisma 7\", \"PN vs Drizzle\", \"PN vs Kysely\", \"PN vs TypeORM\". Do NOT use when the prompt clearly matches a workflow skill — adoption \u002F quickstart \u002F first-touch orientation \u002F brownfield introspection, schema \u002F contract editing, migration authoring (db update \u002F migration plan \u002F migrate), migration review on deploy \u002F concurrent migrations, queries \u002F db.orm \u002F db.sql \u002F TypedSQL, Supabase \u002F RLS \u002F role binding, runtime \u002F db.ts \u002F middleware wiring, build \u002F Vite plugin \u002F Next.js plugin, debug \u002F structured error envelopes \u002F PN-* error codes, or feedback \u002F bug report \u002F feature request — load that sibling skill directly.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[7703,7704,7705,7706],{"name":17,"slug":18,"type":15},{"name":13,"slug":14,"type":15},{"name":9,"slug":8,"type":15},{"name":7707,"slug":678,"type":15},"TypeScript","2026-07-17T05:32:04.322957",{"slug":271,"name":271,"fn":7710,"description":7711,"org":7712,"tags":7713,"stars":23,"repoUrl":24,"updatedAt":7721},"integrate Prisma Next into build systems","Wire Prisma Next into the project's build system with the right build-tool plugin — Vite today via @prisma-next\u002Fvite-plugin-contract-emit (Vite 7 \u002F 8); Next.js \u002F Webpack \u002F esbuild \u002F Rollup \u002F Turbopack are named as gaps rather than fabricated. Always offers the Vite plugin proactively when the project is using Vite. Use for vite plugin, vite-plugin, vite.config.ts, prismaVitePlugin, contract emit on save, HMR, hot reload contract, dev server, Next.js plugin, next plugin, withPrismaNext, webpack plugin, esbuild plugin, rollup plugin, build integration, dev server plugin, vite 7, vite 8.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[7714,7717,7718,7719],{"name":7715,"slug":7716,"type":15},"Deployment","deployment",{"name":13,"slug":14,"type":15},{"name":9,"slug":8,"type":15},{"name":6761,"slug":7720,"type":15},"vite","2026-07-02T07:31:36.108254",{"slug":259,"name":259,"fn":7723,"description":7724,"org":7725,"tags":7726,"stars":23,"repoUrl":24,"updatedAt":7733},"edit Prisma Next data contracts and models","Edit the Prisma Next data contract — add models, fields, relations, indexes, enums, value objects (composite types), type aliases, namespaces (Postgres schemas), cross-contract foreign keys (cross-space FK), polymorphic types (`@@discriminator` \u002F `@@base`), use extension namespaces (`pgvector.Vector(...)`, `cipherstash.EncryptedString(...)`), wire `prisma-next.config.ts` with `defineConfig` from the `@prisma-next\u002F\u003Ctarget>\u002Fconfig` façade, and run `prisma-next contract emit`. Use for schema, models, fields, attributes, soft delete, paranoid, scopes, validations, callbacks, prisma schema, PSL, contract.prisma, contract.ts, contract.json, contract.d.ts, `@prisma-next\u002Fpostgres\u002Fconfig`, `@prisma-next\u002Fpostgres\u002Fcontract-builder`, `@prisma-next\u002Fpostgres\u002Fcontrol`, `@prisma-next\u002Fmongo\u002Fconfig`, `@prisma-next\u002Fmongo\u002Fcontract-builder`, `extensions:`, pgvector, cipherstash, postgis, paradedb, supabase, `@prisma-next\u002Fextension-supabase`, `@@control`, control policy, managed, tolerated, external, observed.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[7727,7730,7731,7732],{"name":7728,"slug":7729,"type":15},"Data Modeling","data-modeling",{"name":17,"slug":18,"type":15},{"name":9,"slug":8,"type":15},{"name":7707,"slug":678,"type":15},"2026-07-30T05:30:10.426962",{"slug":283,"name":283,"fn":7735,"description":7736,"org":7737,"tags":7738,"stars":23,"repoUrl":24,"updatedAt":7745},"debug and recover from Prisma Next errors","Read a Prisma Next structured error envelope and route to the right recovery — code, domain, severity, why, fix, meta. Use for error, exception, my emit failed, my query won't typecheck, my query crashed, my migration won't apply, MIGRATION.HASH_MISMATCH, BUDGET.ROWS_EXCEEDED, BUDGET.TIME_EXCEEDED, RUNTIME.ABORTED, PLAN.HASH_MISMATCH, CONTRACT.MARKER_MISSING, PN-RUN-3001, PN-RUN-3002, PN-RUN-3030, PN-MIG-2001, PN-CLI-4011, PN-SCHEMA-0001, drift, capability missing, planner conflict, prisma studio, EXPLAIN, query log, db.end, db.close, script won't exit, hangs, close connection, pool.end, client is closed.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[7739,7740,7743,7744],{"name":17,"slug":18,"type":15},{"name":7741,"slug":7742,"type":15},"Debugging","debugging",{"name":13,"slug":14,"type":15},{"name":9,"slug":8,"type":15},"2026-07-24T05:37:10.436314",{"slug":295,"name":295,"fn":7747,"description":7748,"org":7749,"tags":7750,"stars":23,"repoUrl":24,"updatedAt":7758},"report Prisma Next issues and feedback","Hand a Prisma Next question or report off to the team — file a GitHub issue (bug or feature request), or route Q&A \u002F design discussion \u002F direct-team-contact to the Prisma Discord at pris.ly\u002Fdiscord. Use for bug, bug report, file an issue, report a bug, feature request, missing feature, this should be a feature, file this, this is a bug, this is broken, surprising behaviour, this doesn't work, file feedback, send feedback, capability gap, file via prisma-next-feedback, ask the team, talk to the team, talk to the Prisma team, talk to Prisma, Discord, Prisma Discord, Q&A, design feedback, is this the intended way, how should I do X, extension author question, extension author needs help.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[7751,7754,7757],{"name":7752,"slug":7753,"type":15},"Documentation","documentation",{"name":7755,"slug":7756,"type":15},"GitHub","github",{"name":9,"slug":8,"type":15},"2026-07-02T07:31:34.870809",{"slug":7760,"name":7760,"fn":7761,"description":7762,"org":7763,"tags":7764,"stars":23,"repoUrl":24,"updatedAt":7776},"prisma-next-migration-review","review and resolve Prisma Next migrations","Review what Prisma Next migrations will run on merge or deploy, render the migration graph, resolve concurrent \u002F diamond-convergence conflicts, and configure environment refs for CI. Use for \"what migrations are going to run\", \"what runs on deploy\", merge conflict, diamond convergence, concurrent migrations, migration status, ref management, staging, production, MIGRATION.DIVERGED, MIGRATION.NO_MARKER, MIGRATION.MARKER_NOT_IN_HISTORY, prisma migrate status, prisma migrate diff, prisma migrate resolve.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[7765,7768,7771,7772,7775],{"name":7766,"slug":7767,"type":15},"CI\u002FCD","ci-cd",{"name":7769,"slug":7770,"type":15},"Code Review","code-review",{"name":17,"slug":18,"type":15},{"name":7773,"slug":7774,"type":15},"Migration","migration",{"name":9,"slug":8,"type":15},"2026-07-24T05:37:11.422323",{"slug":7778,"name":7778,"fn":7779,"description":7780,"org":7781,"tags":7782,"stars":23,"repoUrl":24,"updatedAt":7787},"prisma-next-migrations","author and manage Prisma Next migrations","Author Prisma Next migrations — choose db update vs migration plan, edit the framework-rendered migration.ts (replace placeholder sentinels with dataTransform closures), recover from MIGRATION.HASH_MISMATCH or PN-MIG-2001 unfilled placeholder. Use for prisma migrate dev, prisma migrate deploy, prisma db push, db update, db update --dry-run, migration plan, migrate, migration new, migration show, db verify, db sign, data migration, this.dataTransform, dataTransform, placeholder, generated migration.ts, edit migration.ts, MIGRATION.HASH_MISMATCH, schema drift.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[7783,7784,7785,7786],{"name":17,"slug":18,"type":15},{"name":7773,"slug":7774,"type":15},{"name":9,"slug":8,"type":15},{"name":7707,"slug":678,"type":15},"2026-07-24T05:37:13.469138",{"items":7789,"total":4211},[7790,7797,7804,7811,7818,7824,7832,7839,7851,7862,7869,7884],{"slug":7698,"name":7698,"fn":7699,"description":7700,"org":7791,"tags":7792,"stars":23,"repoUrl":24,"updatedAt":7708},{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[7793,7794,7795,7796],{"name":17,"slug":18,"type":15},{"name":13,"slug":14,"type":15},{"name":9,"slug":8,"type":15},{"name":7707,"slug":678,"type":15},{"slug":271,"name":271,"fn":7710,"description":7711,"org":7798,"tags":7799,"stars":23,"repoUrl":24,"updatedAt":7721},{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[7800,7801,7802,7803],{"name":7715,"slug":7716,"type":15},{"name":13,"slug":14,"type":15},{"name":9,"slug":8,"type":15},{"name":6761,"slug":7720,"type":15},{"slug":259,"name":259,"fn":7723,"description":7724,"org":7805,"tags":7806,"stars":23,"repoUrl":24,"updatedAt":7733},{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[7807,7808,7809,7810],{"name":7728,"slug":7729,"type":15},{"name":17,"slug":18,"type":15},{"name":9,"slug":8,"type":15},{"name":7707,"slug":678,"type":15},{"slug":283,"name":283,"fn":7735,"description":7736,"org":7812,"tags":7813,"stars":23,"repoUrl":24,"updatedAt":7745},{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[7814,7815,7816,7817],{"name":17,"slug":18,"type":15},{"name":7741,"slug":7742,"type":15},{"name":13,"slug":14,"type":15},{"name":9,"slug":8,"type":15},{"slug":295,"name":295,"fn":7747,"description":7748,"org":7819,"tags":7820,"stars":23,"repoUrl":24,"updatedAt":7758},{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[7821,7822,7823],{"name":7752,"slug":7753,"type":15},{"name":7755,"slug":7756,"type":15},{"name":9,"slug":8,"type":15},{"slug":7760,"name":7760,"fn":7761,"description":7762,"org":7825,"tags":7826,"stars":23,"repoUrl":24,"updatedAt":7776},{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[7827,7828,7829,7830,7831],{"name":7766,"slug":7767,"type":15},{"name":7769,"slug":7770,"type":15},{"name":17,"slug":18,"type":15},{"name":7773,"slug":7774,"type":15},{"name":9,"slug":8,"type":15},{"slug":7778,"name":7778,"fn":7779,"description":7780,"org":7833,"tags":7834,"stars":23,"repoUrl":24,"updatedAt":7787},{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[7835,7836,7837,7838],{"name":17,"slug":18,"type":15},{"name":7773,"slug":7774,"type":15},{"name":9,"slug":8,"type":15},{"name":7707,"slug":678,"type":15},{"slug":204,"name":204,"fn":7840,"description":7841,"org":7842,"tags":7843,"stars":23,"repoUrl":24,"updatedAt":7850},"write Prisma Next queries for database operations","Write Prisma Next queries for Postgres, SQLite, or Mongo — pick a lane (Postgres\u002FSQLite `db.orm.\u003CModel>` + `db.sql.\u003Ctable>`; Mongo `db.orm.\u003Croot>` + `db.query.from(...)` pipeline builder), filter \u002F project \u002F sort \u002F paginate, eager-load with `.include(...)`, Postgres\u002FSQLite `db.transaction(...)`, Postgres\u002FSQLite ORM `.aggregate(...)`, Mongo aggregations via query builder, namespace-aware accessors (`db.orm.\u003Cns>.\u003CModel>`, `db.sql.\u003Cns>.\u003Ctable>`). Triggers: query, where, match, select, project, orderBy, take, skip, include, lookup, first, all, count, aggregate, group, create, update, delete, upsert, returning, transaction, db.close, script teardown, variant, polymorphism, drizzle-style, kysely-style. Notes: `.all()` is a Thenable (just `await` it), iterators are single-use (`RUNTIME.ITERATOR_CONSUMED`), Postgres `count` is `number` while sum\u002Favg\u002Fmin\u002Fmax are `number | null`, ranges use chained `.where()` or `and(...)` (no `.between(...)`).",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[7844,7845,7846,7847,7848],{"name":17,"slug":18,"type":15},{"name":13,"slug":14,"type":15},{"name":21,"slug":22,"type":15},{"name":9,"slug":8,"type":15},{"name":7849,"slug":5687,"type":15},"SQL","2026-07-17T05:32:03.35373",{"slug":1025,"name":1025,"fn":7852,"description":7853,"org":7854,"tags":7855,"stars":23,"repoUrl":24,"updatedAt":7861},"adopt Prisma Next in projects","Adopt Prisma Next into a new project, onto an existing database, or as the first move after a bootstrap tool dropped you into a scaffold. Use for \"what can I do with Prisma Next\", \"what can I do next with Prisma\", \"where do I start\", \"what should I do first\", \"just ran createprisma\", \"createprisma\", \"npx createprisma\", \"npx create-prisma\", \"first steps\", \"first query\", \"I have a scaffolded Prisma Next project what now\"; for `pnpm dlx prisma-next init` greenfield setup; and for `prisma-next contract infer` + `db sign` against an existing database. Also covers the connect-write-read first-arc orientation, the day-to-day commands (`contract emit`, `db init`, `db update`, `migration plan`, `migrate`, `db schema`, `db verify`), and routing to `prisma-next-contract` \u002F `prisma-next-queries` \u002F `prisma-next-runtime` for the next move. Flags: --target, --authoring, --schema-path, --probe-db, --output.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[7856,7857,7859,7860],{"name":17,"slug":18,"type":15},{"name":7858,"slug":1455,"type":15},"ORM",{"name":9,"slug":8,"type":15},{"name":7707,"slug":678,"type":15},"2026-07-24T05:37:12.462072",{"slug":4,"name":4,"fn":5,"description":6,"org":7863,"tags":7864,"stars":23,"repoUrl":24,"updatedAt":25},{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[7865,7866,7867,7868],{"name":17,"slug":18,"type":15},{"name":13,"slug":14,"type":15},{"name":21,"slug":22,"type":15},{"name":9,"slug":8,"type":15},{"slug":247,"name":247,"fn":7870,"description":7871,"org":7872,"tags":7873,"stars":23,"repoUrl":24,"updatedAt":7883},"integrate Prisma with Supabase","Use Prisma Next with a Supabase project via `@prisma-next\u002Fextension-supabase` — wire `extensions: [supabasePack]`, declare cross-space FKs to `supabase:auth.AuthUser`, author RLS policies (`policy_select` \u002F `policy_update` \u002F `@@rls`, `auth.uid()` predicates), build `db.ts` with the `supabase()` factory, bind roles per request (`asUser(jwt)` \u002F `asAnon()` \u002F `asServiceRole()`), query `auth.*` \u002F `storage.*` via the `db.asServiceRole().supabase` admin root, and validate JWTs (`jwksUrl` for current projects \u002F `jwtSecret` for legacy HS256). Use for supabase, RLS, row level security, policy, role binding, anon, authenticated, service_role, auth.users, auth.uid(), JWT, JWKS, SUPABASE_JWKS_URL, SUPABASE_JWT_SECRET, SUPABASE.JWT_INVALID, SUPABASE.CONFIG_INVALID, RoleBoundDb, session pooler, supabase:auth.AuthUser, @prisma-next\u002Fextension-supabase.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[7874,7877,7878,7879,7880],{"name":7875,"slug":7876,"type":15},"Auth","auth",{"name":7858,"slug":1455,"type":15},{"name":21,"slug":22,"type":15},{"name":9,"slug":8,"type":15},{"name":7881,"slug":7882,"type":15},"Supabase","supabase","2026-07-30T05:30:11.065251",{"slug":7885,"name":7885,"fn":7886,"description":7887,"org":7888,"tags":7889,"stars":7897,"repoUrl":7898,"updatedAt":7899},"prisma-cli","run Prisma CLI commands","Prisma ORM CLI commands reference covering init, generate, migrate, db, dev, studio, validate, format, debug, and mcp. Use for ORM\u002Fdatabase CLI workflows, not Prisma Compute app deployment. For Prisma Compute, `@prisma\u002Fcli app deploy`, `compute:deploy`, `create-prisma --deploy`, apps, deployments, logs, or domains, use the `prisma-compute` skill instead. Triggers on \"prisma init\", \"prisma generate\", \"prisma migrate\", \"prisma db\", \"prisma studio\", \"prisma mcp\".",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[7890,7893,7894,7895,7896],{"name":7891,"slug":7892,"type":15},"CLI","cli",{"name":17,"slug":18,"type":15},{"name":7773,"slug":7774,"type":15},{"name":7858,"slug":1455,"type":15},{"name":9,"slug":8,"type":15},44,"https:\u002F\u002Fgithub.com\u002Fprisma\u002Fskills","2026-04-06T18:48:29.140467"]