feat(prisma-postgres): 2026-08-21 spec refresh + typed 409 conflicts - #470
Draft
wmadden wants to merge 3 commits into
Draft
feat(prisma-postgres): 2026-08-21 spec refresh + typed 409 conflicts#470wmadden wants to merge 3 commits into
wmadden wants to merge 3 commits into
Conversation
…age) Bump specs/distilled-spec-prisma-postgres to aafec81 and regenerate the management service: 73 -> 102 generated operations. At the spec level the route count went 95 (22 of them deprecated and skipped by the generator) -> 102 with none deprecated. Added: /v1/buckets (+keys), /v1/builds, alchemy-state routes, service tokens, workspace subscription, github-actions token. Removed upstream: /v1/compute-services/* and /v1/versions/* (superseded by /v1/apps + /v1/deployments). Only compute-services had generated exports (15 removed); /v1/versions/* was deprecated and never generated. No consumers in-tree either way. Both OpenAPI patches still resolve against the new spec unchanged. Signed-off-by: willbot <w.a.madden+machine@gmail.com> Signed-off-by: Will Madden <madden@prisma.io>
Declare the conflict responses the spec omits on five operations so they
surface as the typed Conflict class instead of the catch-all:
- POST /v1/projects, POST /v1/databases, POST /v1/connections,
POST /v1/projects/{projectId}/databases: 409 on a name/default collision
- DELETE /v1/projects/{id}: 409 when the project still owns resources
(it already declared the 400 variant)
Each is backed by a consumer that recovers from the status today. Envelopes
use the generic {error:{code,message,hint}} shape; none of these statuses
carries a documented const code, so no named error class.
Signed-off-by: willbot <w.a.madden+machine@gmail.com>
Signed-off-by: Will Madden <madden@prisma.io>
…ready handle patches/004-add-lifecycle-list-404-responses.patch.json adds the 404 responses the spec omits on two filtered list routes, so they land in the typed unions as NotFound instead of the catch-all: - GET /v1/apps: alchemy's destroyProjectApps treats a 404 from the project-filtered listing as the project already being gone (packages/alchemy/src/Prisma/ComputeLifecycle.ts). - GET /v1/environment-variables: alchemy's destroyComputeEnvironment treats a 404 from the project-filtered lookup as already cleaned up (packages/alchemy/src/Prisma/Compute.ts). Slice 1 removed this same route's 404 as unbacked (F-2); the backing consumer is in the D3 files that were out of that round's scope. Like the 409 round, these are inferred from consumer behavior, not live-probed: if a live run surfaces UnknownPrismaPostgresError here, fix this matcher rather than loosening the consumer. Signed-off-by: willbot <w.a.madden+machine@gmail.com> Signed-off-by: Will Madden <madden@prisma.io>
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.
Refresh
prisma-postgresto the 2026-08-21 Management API spec and type the error responses its consumers already handle. Follow-up to alchemy-run/alchemy#1061: alchemy's Prisma provider is moving off its hand-rolled client onto this SDK, and these are the routes and typed errors it needs.Changes
specs/distilled-spec-prisma-postgres2026-06-30 → 2026-08-21): generated ops 73 → 102. Adds the 7/v1/buckets+ bucket-key routes (the key-create response typesaccessKeyId/secretAccessKeyas sensitive), builds, alchemy-state, service-token, and github-actions-token routes. Upstream removed/v1/compute-services/**(15 generated exports dropped, superseded by/v1/apps+/v1/deployments; nothing in-repo referenced them) and the never-generated deprecated/v1/versions/**spec routes.patches/003: declares five 409 responses the spec omits but consumers already catch — project create/delete, database create (both routes), connection create — using the spec's standard{error:{code,message,hint}}envelope. Each is backed by a realcatchIf(isConflict, …)site in alchemy's Prisma provider; none has a documented machine-readable code, so they surface as the status-mappedConflictclass.Why
The regenerated diff is large but is generated output (
.generated-specs/management.json,src/services/management.ts) — the reviewable surface is the spec pin andpatches/003. Existing patches 001/002 apply cleanly to the new spec unchanged.typecheckandtypecheck:strictgreen.