Custom Data Proxy Fetch Implementation
Nobody has claimed this yet.
Assessment
- Difficulty
- 5/5
- Estimated time
- Over a week
- Newbie friendliness
- 25/100
- Issue type
- Feature
- Clarity
- Mostly clear
- Activity status
- Stale
- Tech stack
- nodejs, typescript
Research direction
Start with packages/engine-core/src/data-proxy/utils/request.ts at the referenced fetch selection, then trace how Prisma Client options reach the Data Proxy engine. Define the supported custom-fetch configuration and verify that Data Proxy requests use it without breaking platform defaults; the payload names no tests, so identify the relevant request or client tests before implementation.
Written by the indexing model from the issue text.
Description
Problem
- Currently, Prisma's Data Proxy chooses between
fetchandnode-fetchbased on the platform used. While this does work, it is incompatible with custom fetch implementations such as Cloudflare'sworkers-honeycomb-loggerwhich relies on a customfetchimplementation for distributed tracing and sub-request analytics.
Suggested solution
- One solution is adding a property to the Prisma Client to allow overiding the
fetchused (for example, under the keycustomFetch). This would need to be passed down somehow to Prisma's Data Proxy in the engine: https://github.com/prisma/prisma/blob/fcaf312d125453a54db41c534917499ef3c99fda/packages/engine-core/src/data-proxy/utils/request.ts#L24-L32
Alternatives
- An alternative would be allowing the user to call Prisma's Data Proxy by themselves (i.e. over HTTPS), with their own fetch implementation.
Additional context
- This entire idea came about because of slow query times with Prisma's Data Proxy (somewhere in the neighborhood of 1.5 seconds for a single query). Allowing a custom
fetchto be provided would simplify analytics for Prisma Data Proxy queries.
- Dominant language
- TypeScript
- Stars
- 47.6k
- Forks
- 2.5k
- Avg merge
- 21h 59m
- Merged PRs (30d)
- 95
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from prisma/orm
-
fix(mongo-orm): .select() combined with .include() drops joined relation fields via $project stage Open
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
-
kind/bug
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Similar issues
-
clawsweeper:fix-shape-clear clawsweeper:queueable-fix clawsweeper:source-repro impact:ux-friction issue-rating: 🦞 diamond lobster no-stale P3
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
community first-timers-only good first issue hacktoberfest help wanted low hanging fruit up-for-grabs
Difficulty 1/5 Under an hour Newbie friendliness 76/100
-
code-quality refactoring
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
github/gh-aw-firewall#8816 ·
-
integration:quickjs org:external priority:backlog topic:code-interpreter topic:middleware type:feature
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
langchain-ai/deepagents#6450 ·
-
Difficulty 1/5 Under an hour Newbie friendliness 88/100
vercel/react-tweet#225 ·