Add option to skip unnecessary `SELECT` after `create()`
## Problem 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.
Posted by ziimakc on Nov 12, 2020, 8:31 PM
Tags
Related issues
- The issue is really the extreme difficulty of programming them, especially for anything sequential (rather than combinatorial).
- I probably could have beared with it if it was only limited to programming, but it showing up in creative fields has made me feel all sor...
- I hate that I'm in deep enough to know what you mean.
- The biggest problem with “AI” is that big corps are shoving it down our throats.
- in the middel of a coding session with 5.6 sol.
- [Hero Run] 535B-A23B on 18T tokens
Raise real-world problems, find people facing the same issue, and discuss solutions.3,000 issues0 comments
reliability (Other)
The issue is really the extreme difficulty of programming them, especially for anything sequential (rather than combinatorial).
I probably could have beared with it if it was only limited to programming, but it showing up in creative fields has made me feel all sor...
I hate that I'm in deep enough to know what you mean.
The biggest problem with “AI” is that big corps are shoving it down our throats.
in the middel of a coding session with 5.6 sol.
[Hero Run] 535B-A23B on 18T tokens
I hate that this is how AI is being used..
inexperienced protobuf user here -- why do non-googlers generally use protobuf?
Add option to skip unnecessary `SELECT` after `create()`
## Problem 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.
Comments (0)
No comments yet. Start the discussion.