Wingy
11/06/2021, 5:04 PMWingy
11/06/2021, 5:05 PMYehonatan Levi
11/06/2021, 5:29 PMRyan Rhodes
11/06/2021, 11:27 PMLucas
11/07/2021, 6:22 AMnexus
in production? Does the prisma team/company helps to maintain it? I am trying to figure out if it's a good option to use in production as we have a lot of issues on the repo plus old commits?
Trying to achieve a code first approach but don't want to use type-graphql
as the code depends heavily on decorators, etc and a more declarative way would be easier to understand/maintain.
Also what are you guys using in production? I have developed several projects writing plain SDL and then using graphql code generator to create types, etc.
I already used plain graphql.js with graphql-code-generator to create resolver types and then implement it separated using the generated types and it was great, but I am about to start a new project and thinking to go 100% with a code first approach.
ThanksGheorghe
11/07/2021, 7:06 AMAdam Vaughn
11/07/2021, 6:30 PMNoel Martin Llevares
11/07/2021, 9:54 PMprisma
) and a dependency (@prisma/client
), it feels like I have to fight my way against Prisma defaults.
I want to make sure my container only has prod dependencies but doing a yarn install --production
will fail because @prisma/client
requires prisma
.Carlos
11/08/2021, 1:01 AMJordansz
11/08/2021, 1:17 PMAnton Reindl
11/08/2021, 1:54 PM@prisma/client did not initialize yet. Please run "prisma generate" and try to import it again.
problem - and tried different custom build commands. So far without any luck.
Link to discussion: https://github.com/prisma/prisma/discussions/10156
🧐 any hints appreciatedjoao.santos
11/08/2021, 2:42 PMOnur Ünal
11/08/2021, 5:46 PMJesus Jimenez
11/08/2021, 8:30 PMthis.prisma.movie...
. The weird thing is that I did exactly the same thing as I did with the movies service with the other two, but I can only access the movie model. I would really appreciate if anyone can help, I've been going a bit crazy over this :Dmartin
11/08/2021, 11:28 PMSecure connection to database my_database and branch dev is established!.
Local address to connect your application: 127.0.0.1:3306 (press ctrl-c to quit)
Prisma schema loaded from prisma/dev/schema.prisma
Datasource "db": MySQL database "my_database" at "localhost:3306"
Error: P1017: Server has closed the connection.
Error: running command with --execute has failed: exit status 1
martin
11/08/2021, 11:28 PMmartin
11/08/2021, 11:36 PMSlackbot
11/09/2021, 2:36 AMgenedy
11/09/2021, 3:02 AMconst queryCompanies = await prisma.$queryRaw`SELECT * FROM "Company" where "name" like '%${searchName}%' and "companyId" in (SELECT "company_id" FROM "staff" where "userId"=${user.user_id} ) OFFSET ${iSkip} ROWS FETCH NEXT ${limit} ROWS ONLY ; `
I am searching by searchNameJonathan Selander
11/09/2021, 9:12 AMLars Ivar Igesund
11/09/2021, 9:34 AMKaushik Agrawal
11/09/2021, 12:15 PMKaushik Agrawal
11/09/2021, 12:17 PMSlackbot
11/09/2021, 1:57 PMReuben Porter
11/09/2021, 2:53 PMcreateMany
?ezeikel
11/09/2021, 3:35 PMcreateMany
but also wanted to create new records in the contributions
table to record which user uploaded the media. I noticed trying to use create
for the nested relation doesn't work as it does in other cases. And I think these docs are saying that you can't access relations inside of a createMany
- https://www.prisma.io/docs/concepts/components/prisma-client/relation-queries#create-multiple-records-and-multiple-related-records
So my question is what would the alternative/workaround way to do this?
createMany: {
data:
processedMedia?.map(singleProcessedMedia => ({
...singleProcessedMedia,
contribution: {
create: {
type: "MEDIA",
user: {
connect: {
id: userId,
},
},
},
},
})) || [],
},
Noel Martin Llevares
11/09/2021, 4:25 PMprisma generate
from inside my docker container. Keeps complaining that libquery_engine-debian-openssl-1.1.x.so.node
is missing even though it is definitely there.
$ yarn generate
yarn run v1.22.15
$ prisma generate
Prisma schema loaded from prisma/schema.prisma
Error: Unable to require(`/opt/node_app/node_modules/prisma/libquery_engine-debian-openssl-1.1.x.so.node`)
libssl.so.1.1: cannot open shared object file: No such file or directory
error Command failed with exit code 1.
info Visit <https://yarnpkg.com/en/docs/cli/run> for documentation about this command.
$ ls -la
total 304
drwxr-xr-x 1 node node 4096 Nov 9 15:54 .
drwxr-xr-x 1 root root 4096 Nov 9 15:32 ..
drwxr-xr-x 2 node node 4096 Nov 9 15:54 cli
drwxr-xr-x 587 node node 20480 Nov 9 15:54 node_modules
-rw-r--r-- 1 node node 2386 Nov 9 02:28 package.json
drwxr-xr-x 3 node node 4096 Nov 9 15:51 prisma
drwxr-xr-x 6 node node 4096 Nov 9 15:54 src
-rw-r--r-- 1 node node 537 Nov 9 02:48 tsconfig.json
-rw-r--r-- 1 node node 256177 Nov 9 02:28 yarn.lock
$ cd node_modules/prisma
$ ls -la
total 39896
drwxr-xr-x 7 node node 4096 Nov 9 15:54 .
drwxr-xr-x 587 node node 20480 Nov 9 15:54 ..
-rw-r--r-- 1 node node 11357 Nov 9 15:52 LICENSE
-rw-r--r-- 1 node node 1849 Nov 9 15:52 README.md
drwxr-xr-x 4 node node 4096 Nov 9 15:53 build
drwxr-xr-x 3 node node 4096 Nov 9 15:53 install
-rwxr-xr-x 1 node node 40784096 Nov 9 15:54 libquery_engine-debian-openssl-1.1.x.so.node
-rw-r--r-- 1 node node 3905 Nov 9 15:52 package.json
drwxr-xr-x 3 node node 4096 Nov 9 15:53 preinstall
drwxr-xr-x 5 node node 4096 Nov 9 15:53 prisma-client
drwxr-xr-x 2 node node 4096 Nov 9 15:53 scripts
$ pwd
/opt/node_app/node_modules/prisma
$
Chris Tsongas
11/09/2021, 7:10 PMconst getUser = await prisma.user.update({
where: {
id: 9
},
data: {
posts: {
connect: {
id: 11
},
create: {
title: "My new post title"
}
}
}
})
Unfortunately, I don't believe this will disconnect previously related posts i.e. a post with an id
of 5
that should no longer be related to this user.
This means that (in this example) when the API receives an array of post IDs that should be related to this user, I first have to query which posts are currently related to the user, then run another query to connect new posts, and yet another query to disconnect old posts.
Think about a situation where on the front end, someone can edit a product and assign it to zero or more categories via a multi-select. Same problem.
Seems unfortunate there's no way to update a many-to-many relation in one operation, or maybe I've missed it? I know you can connect an array of IDs, but again I'm guessing that won't disconnect IDs that aren't in the array, or all IDs if the array is empty.Edward Baer
11/09/2021, 10:08 PMSimoh 2k
11/09/2021, 10:56 PM@Get('getCoiffeurs')
async getCoiffeurs(@Param('roleId') roleId: string): Promise<User> {
return await this.usersService.findAllCoiffeurs({ roleId: roleId });
}
Service :
async findAllCoiffeurs(
userWhereUniqueInput: Prisma.UserWhereUniqueInput,
): Promise<User | null> {
return this.prismaService.user.findUnique({
where: {
roleId: userWhereUniqueInput?.roleId,
},
});
}