Repository navigation
feat: add Prisma provider - #416
Merged
sam-goodwin merged 135 commits intoJul 29, 2026
Merged
Conversation
AmanVarshney01
force-pushed
the
aman/prisma-alchemy-provider
branch
3 times, most recently
from
May 22, 2026 11:45
86a9960 to
f2087fb
Compare
sam-goodwin
reviewed
May 25, 2026
Member
|
Are you planning on adding an effect-native ComputeApp Platform and Bindings? One that works like Cloudflare Workers or Lambda Function? |
AmanVarshney01
force-pushed
the
aman/prisma-alchemy-provider
branch
from
May 26, 2026 06:50
f2087fb to
c3af6c7
Compare
Contributor
Author
Interesting didn’t know about this. I’ll get back to you on this in a bit. |
AmanVarshney01
force-pushed
the
aman/prisma-alchemy-provider
branch
from
May 26, 2026 06:56
c3af6c7 to
0952b7a
Compare
AmanVarshney01
marked this pull request as ready for review
June 16, 2026 12:25
…rovider # Conflicts: # .oxfmtrc.json # bun.lock # packages/alchemy/package.json
…PI surface - rework ConnectionBinding to the single binding convention (alchemy-run#690): combined tag/callable + Binding.Host dispatch inside ConnectionBindingLive, drop Binding.Policy machinery and its Providers registrations - replace the removed Build/Command helper (alchemy-run#673) with a local spawner-based runBuildCommand in ComputeBuild - update shape-typed class forms to the id-only + .make(props, impl) Platform API - add the /v1/apps, /v1/deployments, and build-logs surface to the client, operation helpers, and route-parity tests (96-route coverage) - add ScmInstallation.connected/connectedAt, the connected list filter, and connectScmInstallation for the new SCM connect endpoint; unreleased routes are allowlisted until they ship to the production OpenAPI doc
…rep-5ba5cc # Conflicts: # bun.lock # packages/alchemy/src/Plan.ts
…ehavior - run codemod-alchemy-test over the Prisma (and Command executor) suites - enforce the 1 MiB deployment-log frame limit in parseDeploymentLogRecord: bun's ws shim ignores the socket maxPayload option, so the socket-level bound alone no longer rejects oversized frames - route the managementApi() Providers test down the env-credential path (CI: true) instead of consulting the machine's profile store - make withWebSocketServer's release bounded: bun's ws shim can never fire the server.close callback after a server-initiated client close, which hung the uninterruptible finalizer and the whole test process Co-Authored-By: Claude Fable 5 <[email protected]>
- Prisma.ConnectionBinding/ConnectionBindingLive -> Prisma.Connect/ConnectBinding
(mirrors Cloudflare.Hyperdrive.Connect + ConnectBinding), moved to Connect.ts
- drop connectionUrl()/connectionEnv() helpers; the Connection resource now
materializes databaseUrl (pooled -> direct -> accelerate) plus parsed
origin/pooledOrigin PostgresOrigin attrs, like Planetscale roles and Neon
branches, so Hyperdrive wiring is origin-shaped:
Cloudflare.Hyperdrive.Connection("hd", { origin: connection.origin.as<Prisma.PostgresOrigin>() })
- ConnectClient now returns Redacted connection strings; databaseUrl feeds
SQL.Postgres({ url: db.databaseUrl }) / Drizzle directly
- live Prisma-over-Hyperdrive Worker test + lean fixture (deep imports keep
pglite out of the Worker bundle)
- retry Cloudflare script PUTs on pure transport failures (idempotent upsert)
Co-Authored-By: Claude Fable 5 <[email protected]>
…tack Prisma.providers() provideMerge'd NodeHttpClient.layerNodeHttp, overriding the ambient HttpClient for every provider in a merged stack. Cloudflare Worker script uploads then went out over node:http, which streams multipart bodies as Transfer-Encoding: chunked — api.cloudflare.com never answers chunked uploads, so any stack combining Prisma + Cloudflare providers hung on every Worker deploy. - provide (not provideMerge) the node transport to the Prisma management client only - artifact uploads get a Prisma-scoped PrismaUploadClient service (node transport, needed for Content-Length on presigned URLs); tests that stub the ambient HttpClient fall back to it unchanged - retry Cloudflare script PUTs on pure transport failures (idempotent upsert) Verified live: Prisma Postgres -> Hyperdrive -> Worker SQL round trip with full create/destroy lifecycle, plus the Compute live suite. Co-Authored-By: Claude Fable 5 <[email protected]>
The PR branch's earlier merges of main resolved conflicts by keeping pre-merge versions — silently deleting whole features main had since landed (src/Telemetry.ts, Axiom Telemetry, Docker Swarm/Service/Context and their tests, three docs pages) and rewinding ~50 more files (worker bridges, compat flags, tutorials, astro config). Restored every file that diverges from origin/main and was never touched by a non-merge commit on this branch, keeping the PR's intentional changes (Plan/Apply/Http/Command/State + Prisma) and this prep branch's fixes. bun tsc -b clean. Co-Authored-By: Claude Fable 5 <[email protected]>
…rep-5ba5cc # Conflicts: # packages/alchemy/test/Cloudflare/Website/StaticSite.test.ts # packages/alchemy/test/Cloudflare/Workers/Worker.test.ts # website/src/content/docs/cloudflare/tutorial/part-6.mdx # website/src/content/docs/docker/swarm.mdx
Adds Prisma.providers() to the nuke stack so `bun nuke` (and `--include 'Prisma.*'`) covers Prisma projects/databases/connections. Requires PRISMA_SERVICE_TOKEN (with CI=1) or a configured profile, same as Neon/Planetscale. Verified: nuked 88 leaked distilled-prisma-* test projects, ran the full Prisma suite (351 passed incl. live Compute + Hyperdrive), and the post-suite census is empty — tests leave the account clean. Co-Authored-By: Claude Fable 5 <[email protected]>
Adds the Prisma hub alongside PlanetScale and Neon: - /prisma — overview (resources, Connect binding, the Prisma path) - /prisma/setup — service tokens, login methods, CI - /prisma/data/postgres — Project/Postgres/Branch + @prisma/dev local dev - /prisma/data/connections — databaseUrl, connection strings, origins, Connect binding, rotation - /prisma/compute — framework + Effect-native apps, health-checked promotion, custom domains, dev command - /prisma/guides/cloudflare-workers — Hyperdrive vs Connect wiring Wires the sidebar hub, primary docs tab, Reference list entry, and the Prisma brand icon. Co-Authored-By: Claude Fable 5 <[email protected]>
Connection.name, Branch.gitName, App.displayName, and Compute.appName are now optional. When omitted: - Branch/App/Compute derive a stable physical name via createPhysicalName (stack-id-stage + instance suffix), like Project and Database already did - Connection defaults its name prefix to the logical ID; its existing scheme appends the instance identity, so omitted names recover and adopt exactly like explicit ones Defaults resolve identically across diff/read/reconcile so an omitted name never reads as drift, and dev providers mirror the same shape. Docs and examples now omit names by default. Co-Authored-By: Claude Fable 5 <[email protected]>
…rep-5ba5cc # Conflicts: # packages/alchemy/src/Command/Dev.ts
Sidebar now mirrors the Neon hub shape:
Data { Postgres, Branches, Connections }
Compute { Apps, Deployments }
Guides { Connect from Workers }
- new /prisma/data/branches — attachment, branch-per-stage, default
promotion and its restore-on-destroy behavior
- /prisma/compute split into /prisma/compute/apps (builds, Effect-native,
custom domains, dev) and /prisma/compute/deployments (health-checked
promotion, rollback, destroyOldDeployment, skipCodeUpload, no-op
convergence)
Co-Authored-By: Claude Fable 5 <[email protected]>
john-royal
added a commit
that referenced
this pull request
Jul 30, 2026
Brings in 94 commits from main (local vs live provider modes #963, workersDev/domain props #977, Worker.URL self-binding #964, assets-only Workers #969, Prisma provider #416, version affinity #985, telemetry #860) while preserving this branch's SourceProvider architecture and Website framework integrations. - Worker providers take main's side wholesale; the SourceProvider integration is re-grafted as a dispatch: `props.source` routes through `resolveSource`/`loadSource` (build, hash slots, and local dev in both server and bundle modes via the make-before-break serve path), while script/vite/python/prebuilt/assets-only workers keep main's paths. - Apply.ts: both sides landed the resolved-bindings persistence fix (#874 / ef08f4c); merged as the union, keeping `providerMode` and `bindings` on replaced-state commits. - test Utils/Http.ts: keep main's generalized retryResponse machinery (expectUrlRedirect/expectUrlHeader) and re-add expectDirectStatus on top of it. - Website tests track main's API: `url`/`subdomain` props fold into `workersDev`; dev-mode R2 cleanup skips virtual `dev:` buckets. - cloudflare-tools submodule bumped to this branch's merge of its own upstream main (59c3861); distilled synced to main's pointer. Co-Authored-By: Claude Fable 5 <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Production-grade Prisma provider for Alchemy: declarative resources for Prisma Postgres and Prisma Compute, aligned with the current Prisma Management API, covering framework applications and Effect-native services. Resources reconcile from observed API state, recover from interrupted deployments, and never persist Prisma credentials as plaintext.
Quick start
Names (
Project.name,Database.name,Connection.name,Branch.gitName,App.displayName,Compute.appName) are optional — omitted, alchemy generates stable physical names viaPhysicalName.Provider surface
ProjectDatabase/PostgresBranchConnectionConnect/ConnectBindingApp/Deployment/ComputeEnvironmentVariable,CustomDomain,SourceRepositoryPlus Management API operation helpers, deployment log tailing, and
bun nukecoverage (--include 'Prisma.*').Connections
A
Connectionmaterializes ready-to-use outputs — all secretsRedacted:originfeeds straight into Cloudflare Hyperdrive, the same shape Neon branches and PlanetScale roles materialize:Covered by a live test that deploys a Worker querying Prisma Postgres through Hyperdrive with
SQL.Postgres.Runtime binding
Prisma.Connectresolves a bound connection inside a Compute app, Lambda function, or Cloudflare Worker —db.databaseUrlplugs directly intoSQL.Postgres/ Drizzle:Deployment lifecycle
A Compute update is fail-closed: build → upload (bounded, streamed I/O) → start candidate → verify preview health → promote → confirm latest → verify stable endpoint → only then stop/destroy the previous deployment. Failed or ambiguous operations preserve the last healthy deployment; terminally failed deployments are never restarted or chosen as rollback targets.
Hardening includes observed-state reconciliation with explicit adoption, idempotent lifecycle paths, bounded retries and subprocess timeouts, process-group termination of timed-out builds, path-traversal/symlink/artifact-mutation checks, and redaction of connection strings and service tokens from state, logs, errors, and subprocess output. Ambient Prisma credentials are withheld from build and migration subprocesses.
Local development
bun alchemy devruns the whole stack against a local@prisma/devPostgres with zero credentials;dev.migrateon the database anddev.commandon Compute wire up migrations and the local app.Management API compatibility
Synchronized with the current
prisma/pdp-control-planeManagement API: canonical/v1/appsand/v1/deploymentsroutes, all 71 canonical provider routes covered, the contract pinned to the current 102 public operations (24 deprecated aliases and 7 Object Storage routes explicitly deferred), API state as the source of truth during reconciliation.Docs
Dedicated provider hub at
/prisma(overview, setup, Postgres, connections, Compute, and a Workers guide), wired into the docs tabs and sidebar like PlanetScale and Neon.Examples
Connectbinding, an Effect HTTP service, and health verificationconnection.databaseUrl