Skip to content

docs(sql): add cross-provider guides and Aurora examples - #1737

Merged
sam-goodwin merged 29 commits into
mainfrom
docs/sql-provider-discovery
Sep 21, 2026
Merged

sam-goodwin merged 29 commits into
mainfrom
docs/sql-provider-discovery

Conversation

@sam-goodwin

@sam-goodwin sam-goodwin commented Sep 20, 2026 •

Copy link
Copy Markdown
Contributor

Add cross-provider SQL guides and runnable Drizzle examples for Aurora PostgreSQL and Aurora DSQL.

  • Show bindings and queries inside their Service, Worker, Lambda, or Compute runtime; link to deployment guides.
  • Use IAM authentication, verified TLS, non-admin database roles, and deployment-only schema setup in the AWS examples.

sam-goodwin and others added 20 commits August 12, 2026 09:16
Adds Prisma.Contract + Prisma.Migrate deploy-time resources, the
alchemy/Prisma/ORM/Postgres runtime binding (per-execution pool,
workerd-safe), /sql/prisma docs, and the cloudflare-neon-prisma
example. Pinned to 8.0.0-rc.1.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Queries are now Effects: db.orm chains prisma-next's Collection via a
path-replaying proxy (lazy, re-runnable, typed rows preserved through
include/select), db.sql plans run through an Effect executor
(execute/stream), and db.transaction commits/rolls back by exit status
with a typed PrismaRollbackError. Errors surface as tagged
PrismaQueryError (sqlState/constraint), PrismaConnectionError
(transient), and PrismaError. No upstream changes — built entirely on
prisma-next's public seams; db.use remains the escape hatch.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Prisma 8's headline authoring form is the defineContract TS DSL, not
PSL. The example, docs, and PR walkthrough now lead with it (PSL stays
supported — the integration is authoring-agnostic). Works around an
rc.1 bug where TS-authored emits write unpublished @internal/* import
specifiers into contract.d.ts: Prisma.Contract rewrites them to the
public @prisma/orm-postgres/* subpaths after emit (no-op for PSL),
failing actionably on unmapped specifiers.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Each SQL integrity violation gets its own tag (Unique/ForeignKey/
NotNull/CheckViolationError via driver-normalized SQLSTATE 23xxx), and
prisma-next's structured codes split by category into PrismaOrmError /
PrismaRuntimeError with an autocompleting open-union code field.
Tag-per-category rather than tag-per-code: SQLSTATEs and categories
are stable across RCs, individual codes churn. PrismaError remains
only for truly unclassified throws.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Errors live in the Prisma namespace, so the prefix was noise:
Prisma.UniqueViolationError, Prisma.QueryError, Prisma.OrmError,
Prisma.RuntimeError, Prisma.ConnectionError, Prisma.RollbackError,
Prisma.CliError (deploy-time), Prisma.UnknownError (fallback),
Prisma.ClientError (union), Prisma.ErrorCode. Tags renamed to match
(e.g. "Prisma.UniqueViolationError").

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Same linguist-generated marks prisma-next init scaffolds; migration.ts
stays unmarked as the placeholder editing surface.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Resolves the pnpm-catalog migration (bun workspaces -> pnpm named
catalogs), the Prisma Providers.ts restructure (per-resource
ProviderLayer.dual replaced the dev/live implementationLayer switch),
and drops the retired bun.lock.

Claude-Session: https://claude.ai/code/session_01QVa7UvSQr7Y5xBqXMFbmc2
The `prisma-next` bin is retired (rc.2) and the config hard-cut landed in
rc.4: the unified `prisma` CLI mounts the ORM commands and reads only
`prisma.config.ts` in the engine envelope shape.

- `Prisma.Contract` / `Prisma.Migrate` shell `prisma contract emit`,
  `prisma migration plan`, and `prisma db migrate` (was `prisma-next
  migrate`), resolving the bin from the optional `prisma` peer.
- `--json` is now a newline-delimited event stream closed by a
  `{ kind: "result", envelope }` document; the runner parses that
  envelope and maps `envelope.error` (`code`/`summary`/`why`/`meta`,
  `DRIVER.CONNECTION_FAILED`) onto `Prisma.CliError`.
- Runtime: row plans execute through `runtime().query(plan)` (rc.2 split
  `query` from `execute`), transaction lanes bind `orm({ runtime: txn })`,
  and ORM pagination is `.limit()` / `.offset()` (rc.7 rename).
- Config files move to `prisma.config.ts` with
  `definePrismaConfig({ orm: ormConfig({ ... }) })`; fixtures, example,
  and docs follow. Contract artifacts + migration packages regenerated.
- The example's `createdAt` takes the text representation
  (`field.temporal.createdAtString()`): rc.6 made temporal columns decode
  to `Temporal.*`, which workerd has no implementation for.
- Emitted `contract.d.ts` files are checked in (they leak unpublished
  `@internal/*` specifiers the resource rewrites) so a clean checkout
  typechecks without running a deploy.

Claude-Session: https://claude.ai/code/session_01QVa7UvSQr7Y5xBqXMFbmc2
The example was never listed in the root tsconfig references, so `tsc -b`
never compiled it — and it did not compile:

- `import type { Contract } from "./prisma/contract.d.ts"` resolved to the
  contract *source* (`contract.ts`) next to it. Emit now writes to
  `src/prisma/generated/`, matching the test fixtures.
- `field.id.uuidv7String()` types the id as a branded `Char<36>`, so an id
  parsed out of a URL cannot be passed to `where({ id })`. Native uuid
  columns (`field.id.uuidv7Native()` / `field.uuidNative()`) keep the TS
  type a plain string.
- `prisma.config.ts` and the TypeScript-authored contract source infer
  types that cannot be named portably from this project (TS2883); both are
  loaded by the prisma CLI under its own toolchain, so they are excluded
  the same way the test fixtures' configs are.

Claude-Session: https://claude.ai/code/session_01QVa7UvSQr7Y5xBqXMFbmc2
…lan-4f746c

# Conflicts:
#	packages/alchemy/tsconfig.test.json
#	pnpm-lock.yaml
…lan-4f746c

# Conflicts:
#	packages/alchemy/package.json
#	packages/alchemy/src/Prisma/Providers.ts
#	pnpm-lock.yaml
#	pnpm-workspace.yaml
@sam-goodwin sam-goodwin changed the title docs(sql): add provider-oriented SQL discovery docs(sql): add cross-provider guides and Aurora examples Sep 20, 2026
@alchemy-version-bot

alchemy-version-bot Bot commented Sep 20, 2026 •

Copy link
Copy Markdown
Contributor

Install the packages built from this commit:

alchemy

pnpm install https://pkg.alchemy.run/alchemy/pr:1737:c03d137
@alchemy.run (6)
pnpm install https://pkg.alchemy.run/@alchemy.run/better-auth/pr:1737:c03d137
pnpm install https://pkg.alchemy.run/@alchemy.run/cloudflare-runtime/pr:1737:c03d137
pnpm install https://pkg.alchemy.run/@alchemy.run/frontend-frameworks/pr:1737:c03d137
pnpm install https://pkg.alchemy.run/@alchemy.run/node-utils/pr:1737:c03d137
pnpm install https://pkg.alchemy.run/@alchemy.run/floci/pr:1737:c03d137
pnpm install https://pkg.alchemy.run/@alchemy.run/pkg/pr:1737:c03d137
@distilled.cloud (14)
pnpm install https://pkg.alchemy.run/@distilled.cloud/core/pr:1737:c03d137
pnpm install https://pkg.alchemy.run/@distilled.cloud/acme/pr:1737:c03d137
pnpm install https://pkg.alchemy.run/@distilled.cloud/aws/pr:1737:c03d137
pnpm install https://pkg.alchemy.run/@distilled.cloud/axiom/pr:1737:c03d137
pnpm install https://pkg.alchemy.run/@distilled.cloud/cloudflare/pr:1737:c03d137
pnpm install https://pkg.alchemy.run/@distilled.cloud/fly-io/pr:1737:c03d137
pnpm install https://pkg.alchemy.run/@distilled.cloud/github/pr:1737:c03d137
pnpm install https://pkg.alchemy.run/@distilled.cloud/hetzner/pr:1737:c03d137
pnpm install https://pkg.alchemy.run/@distilled.cloud/neon/pr:1737:c03d137
pnpm install https://pkg.alchemy.run/@distilled.cloud/prisma/pr:1737:c03d137
pnpm install https://pkg.alchemy.run/@distilled.cloud/planetscale/pr:1737:c03d137
pnpm install https://pkg.alchemy.run/@distilled.cloud/railway/pr:1737:c03d137
pnpm install https://pkg.alchemy.run/@distilled.cloud/stripe/pr:1737:c03d137
pnpm install https://pkg.alchemy.run/@distilled.cloud/zerossl/pr:1737:c03d137

Published Sep 21, 2026, 7:13 AM UTC. Expires Sep 28, 2026, 7:13 AM UTC, extended while this pull request is open.

Base automatically changed from claude/prisma-v8-rc-plan-4f746c to main September 21, 2026 05:51
@sam-goodwin
sam-goodwin merged commit d74f65d into main Sep 21, 2026
7 of 8 checks passed
@sam-goodwin
sam-goodwin deleted the docs/sql-provider-discovery branch September 21, 2026 07:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants