feat(miniflare): Add implementation for local explorer D1 API#12267
feat(miniflare): Add implementation for local explorer D1 API#12267
Conversation
🦋 Changeset detectedLatest commit: 94888cc The changes in this PR will be included in the next version bump. Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
|
Claude finished @NuroDev's task —— View job Changeset Review
Issue: Missing experimental feature opt-in noteAccording to the changeset guidelines (line 23 of
The changeset correctly identifies this as work on an "experimental/WIP local resource explorer" in the title, but should include information about how users can opt in to or use this experimental feature. RecommendationAdd a note explaining how users can access or enable this experimental feature. For example: ---
"miniflare": minor
---
Implement local D1 API for experimental/WIP local resource explorer
The following APIs have been (mostly) implemented:
- `GET /d1/database` - Returns a list of D1 databases.
- `POST /d1/database/{database_id}/raw` - Returns the query result rows as arrays rather than objects.
**Note**: This is an experimental feature for the local resource explorer. [Add details about how to enable/use this feature]Other validation results✅ Version Type: |
create-cloudflare
@cloudflare/kv-asset-handler
miniflare
@cloudflare/pages-shared
@cloudflare/unenv-preset
@cloudflare/vite-plugin
@cloudflare/vitest-pool-workers
@cloudflare/workers-editor-shared
@cloudflare/workers-utils
wrangler
commit: |
packages/miniflare/src/workers/local-explorer/openapi.local.json
Outdated
Show resolved
Hide resolved
…stead of OIDC" This reverts commit c5bc0d7.
This reverts commit 76863dd.
| // The base API response schemas define `result` as a generic object, | ||
| // but child schemas override it with specific types (e.g., arrays). | ||
| // OpenAPI's `allOf` is meant to merge schemas, but @hey-api/openapi-ts | ||
| // generates Zod's `.and()` (intersection), which doesn't allow property | ||
| // overrides. Removing `result` from base schemas allows child schemas | ||
| // to define their own `result` type without conflicts. |
There was a problem hiding this comment.
@NuroDev @emily-shen is this something that should be improved or fixed in @hey-api? I'm not clear whether this is a Zod limitation or an issue with the library
This PR follows on from #12152 and adds a D1 compatible API to the local explorer API worker. That includes adding the following endpoints with their respective handling logic:
GET /d1/database- Returns a list of D1 databases.POST /d1/database/{database_id}/raw- Returns the query result rows as arrays rather than objects.A picture of a cute animal (not mandatory, but encouraged)