Add option to skip unnecessary select after create
See original GitHub issueProblem
Every time you do operation with prisma-client it will make unnecessary select and return value
Query:
db.log
.create({
data: {
smth: 1
},
select: { uuid: true }, // unnecessary select, even if you delete this line
})
Logs:
prisma:query COMMIT
prisma:query BEGIN
prisma:query INSERT INTO "public"."log" ("smth") VALUES ($1) RETURNING "public"."log"."uuid"
prisma:query SELECT "public"."log"."uuid" FROM "public"."log" WHERE "public"."log"."uuid" = $1 LIMIT $2 OFFSET $3
prisma:query COMMIT
Suggested solution
Add option to skip select after insert or update (in case of operation fail error is thrown by default)
db.log
.create({
data: {
smth: 1
},
select: false
})
Logs:
prisma:query COMMIT
prisma:query BEGIN
prisma:query INSERT INTO "public"."log" ("smth") VALUES ($1)"
prisma:query COMMIT
Alternative solution (breaking change)
Do not return anything after insert or update if select was not explicitly set.
Issue Analytics
- State:
- Created 3 years ago
- Reactions:56
- Comments:17 (2 by maintainers)
Top Results From Across the Web
How to remove/skip empty lines from option select list
Hi Folks ^^ this worked for me : <select formControlName="type" id="type" > <option [selected]=true [disabled]="true" value="" >Choose ...
Read more >Manage email messages by using rules - Microsoft Support
Right-click a message in your inbox or another email folder and select Rules. Right-click a message you received to create a rule. Select...
Read more >Skip Logic - Qualtrics
Additional Skip Logic Options. After adding skip logic to a question, you can select the skip logic dropdown menu to the right of...
Read more >How to INSERT If Row Does Not Exist (UPSERT) in MySQL
Learn how to INSERT an If Row Does Not Exist (UPSERT) in MySQL. MySQL provides a number of useful statements when it is...
Read more >Question Skip Logic | SurveyMonkey Help
Video Overview; Question Types; Adding Logic; Page Options; Details ... Question Skip Logic lets you skip respondents to a later page, or a...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Is there any movement on this? Not sure if this is as relevant, but those select’s (after insert even though I haven’t specified a
select
argument) do eat into the transaction buffer limit.Would appreciate an option to remove the unnecessary select