Andy
07/02/2021, 6:42 PMSequential
07/02/2021, 6:49 PMGustavo Adolfo López
07/02/2021, 9:11 PMbinaryTargets
value as an environment variable? I’m deploying to AWS and setting the config to binaryTargets = ["native", "rhel-openssl-1.0.x"]
works just fine, however I don’t want to include the native
binary as it increases the lambda size considerablyMarc
07/02/2021, 11:03 PMcreateMany
, but it seems it couldn’t be found. Property 'createMany' does not exist on type.
I’m using v2.26.0
and sqlite. I’ve tried to put it into previewFeature, but I then get Please either remove the "createMany" feature flag or use any other database type that Prisma supports: postgres, mysql or sqlserver.
Any idea?khareta
07/02/2021, 11:23 PMMarc
07/02/2021, 11:26 PM2.6.2
to 2.26.0
and get now query times that are twice as slow. From 56ms to 121ms. Still sqlite. Any idea why there is a performance degradation between those versions?Juan Raymundo Carrillo Jasso
07/03/2021, 12:05 AMSELECT
*
FROM
public."City"
WHERE
word_similarity(LOWER(unaccent(name)), LOWER(unaccent('mexico'))) > 0.3
ORDER BY
name
how would I do this with prisma?
Note: I already have the plugins installed in the migrationsChris Tsongas
07/03/2021, 1:57 AMroles Role[] @default([Role.USER])
? I'm getting a syntax error.Gustavo Adolfo López
07/03/2021, 3:03 AMyoenho park
07/03/2021, 5:23 AMSamTheFam
07/03/2021, 12:06 PMRidhwaan Shakeel
07/03/2021, 9:54 PMnpx prisma migrate reset
but not for dropping a single relationVinaya Sathyanarayana
07/04/2021, 3:19 AMEddy Nguyen
07/04/2021, 7:18 AMclient.binaryTargets
.
It looks like there’s this issue which has been addressed in this PR. However, I’m still having problems, and may be someone can help clarify how I’m supposed to use it.
Here’s the related part in my schema:
generator client {
provider = "prisma-client-js"
binaryTargets = env("PRISMA_BINARY_TARGET") // I also tried to use `[env("PRISMA_BINARY_TARGET")]` but getting the same errors regardless
}
I have JSON.parse
error when I try to do this: PRISMA_BINARY_TARGET=native prisma generate
. Note that this was working in version 2.22
I think it’s because the parse function expects the env to be a JSON string 🤔
Anyways, running the following command works: PRISMA_BINARY_TARGET='[\"native\"]' prisma generate
. To me, this is less ideal than the previous version because I didn’t know what to use until I looked at the source code. 😅 ( Maybe there are some documentation I’m missing )
Is this a bug? Happy to create an issue to follow up 🙂Moh
07/04/2021, 9:35 AMjasci
07/04/2021, 11:12 AMnull
if it’s defined as a list ? Like String[]
?glekner
07/04/2021, 1:15 PMJared Fraser
07/05/2021, 4:52 AMtype=item
SQL i'm trying to mimic
SELECT *
FROM a
LEFT JOIN b
LEFT JOIN c
LEFT JOIN d
WHERE d.type='item'
this.prisma.A.findMany({
include: {
B: {
include: {
C: {
include: {
d: {
where: {
type: 'item'
}
}
}
}
}
}
}
})
Vladi Stevanovic
janpio
Moshe
07/05/2021, 11:24 AMprisma
and it sits on the root folder of my nextjs project. I'd like to name it db
and have it within the src
folder. Is that possible? If so, how? Thanks 🙂Stephen
07/05/2021, 12:43 PMDev__
07/05/2021, 12:51 PMORDER BY
this.prisma.$queryRaw`
SELECT *
FROM "public"."OrderStatus"
INNER JOIN "public"."OrderStatusDescription" ON ("public"."OrderStatus"."id" = "public"."OrderStatusDescription"."orderStatusId")
WHERE "public"."OrderStatusDescription"."languageId" = ${languageId}
ORDER BY "public"."OrderStatusDescription"."name" DESC LIMIT ${pagination.take} OFFSET ${pagination.skip}
`
the moment I have a variable instead of hardcoded DESC
the query doesnt work.
ORDER BY "public"."OrderStatusDescription"."name" ${order.toUpperCase()} // order = 'asc' | 'desc'
Lucas
07/05/2021, 3:09 PMDavid
07/05/2021, 3:13 PMprisma.query.create
as follows (where queryService(data) is just calling prisma.create({data})
):
const query = await this.queryService.createQuery({
genome: s.slice(0,10),
type: 'Auto',
description: form.description,
user: {
connect: {id: user.id}
}
});
This produces the error pretty much no matter what I do. I logged the object I'm trying to insert, seems fine... so I don't see what the problem is. The relevant model is:
model Query {
id String @id @default(uuid())
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
user User @relation(fields: [userId], references: [id])
userId String
genome String
type GenomeType @default(Auto)
description String?
result String?
}
Would appreciate any help!Giorgio Delgado
07/05/2021, 4:41 PMprisma.modelName.queryName
methods - but after the query successfully complets.
As a contrived example, let’s say I have a model like this:
model Person {
id @id @default(cuid())
first_name String
gender Gender
}
Now what if I want to modify first_name
after fetching it from the database to include Mr
or Ms
.
so that if i do:
const bob = await prisma.person.findFirst({
where: { id: someCuid }
})
Then bob.first_name
should say Mr. bob
or something like that.
I know that Prisma has middleware using prisma.$use
but I don’t quite understand how i’d go about doing this since this is a post-query modification … as opposed to a pre-query modification that I see examples of in the docsBruno Casado
07/05/2021, 8:36 PMBruno Casado
07/05/2021, 8:36 PMBruno Casado
07/05/2021, 8:37 PMAhmar Suhail
07/06/2021, 8:21 AMprisma migrate
and currently we use sequelize migrations to make changes to our DB. So whenever we need to make a change to our DB our process is:
• Run sequelize migrate
• run prisma introspect manually on all our services that use prisma & commit
I am just wondering if there's a better way to do this? (eg: Should we be generating our prisma schemas on build time?)