hey is it possible to skip the select when creatin...
# orm-help
p
hey is it possible to skip the select when creating a new entry?
n
Hey Phil 👋 can you elaborate on your question a bit? If you’re wondering whether you can send a
create
query with Prisma Client without using a
select
option, the answer is yes though 🙂
p
hey nikolas, how exactly can I do that? Would this work?
Copy code
await prisma.profile.create({
        data,
        select: null,
});
n
You don’t need to include
select
in the first place, so this should be enough:
Copy code
await prisma.profile.create({
  data,
});
p
but then it will select the data that was just created according to the query logs 😕
n
Ah, so you want to avoid the
SELECT
statements on the SQL-level? Sorry, this wasn’t clear to me from your initial question. Could you elaborate a bit on your use case for this? I believe entirely removing the
SELECT
is not possible right now, but it would be great if you could open a feature request for this functionality. If you care about the minimum data being selected in the DB query, I guess only selecting the
@id
field would be the best approach.
p
yes exactly on the sql level, sorry for the confusion. there's already an open issue about it here: https://github.com/prisma/prisma/issues/4246 but there hasn't been any movement on it, that's why I asked here anyway thanks for your help!
👍 1