Danny
11/20/2021, 2:44 AMPrisma Client does not yet support batch inserts at a database level. Follow issue #332 on GitHub for updates.Is this true? I had thought
createMany
was about "batch" inserts李白字一日
11/20/2021, 6:02 AMPieter
11/20/2021, 10:42 AMPRISMA_SKIP_POSTINSTALL_GENERATE=1
but its still generating on postinstall (which fails as we got a monorepo so cant define the schema path in package.json)Michael Auderer
11/20/2021, 8:56 PMNoel Martin Llevares
11/21/2021, 1:14 AMdatasource db {
provider = "postgresql"
url = env("DATABASE_URL")
}
Blakelock Brown
11/21/2021, 5:39 AMShawn Williams
11/21/2021, 7:00 AMHei
11/21/2021, 8:20 AMconst countTags = await ctx.prisma.tag.findMany({
select: {
name: true,
_count: {
select: {
questions: true,
},
},
},
});
Since its implicit I cannot call the third table to query it directly.
Here's my schema:
model Question {
id Int @id @default(autoincrement())
title String
content String
tags Tag[]
}
model Tag {
id Int @id @default(autoincrement())
name String @unique
questions Question[]
}
Jin
11/21/2021, 2:48 PMGarrick Chippendale
11/22/2021, 12:10 AMcollectionLogBank Json @default("{}") @db.Json
@@index([collectionLogBank], map: "cl_jsonb")
Error: db error: ERROR: data type json has no default operator class for access method "btree"
HINT: You must specify an operator class for the index or define a default operator class for the data type.
0: sql_migration_connector:sql database step applier:apply_migration
at migration-engine\connectors\sql-migration-connector\src\sql_database_step_applier.rs:11
1: migration_core:api:SchemaPush
at migration-engine\core\src\api.rs:184
any idea for this error?Garrick Chippendale
11/22/2021, 12:28 AMTimo
11/22/2021, 9:20 AMorderBy = [
{
timestamp: 'desc',
},
{
score: {value: 'desc'},
},
]
When I set timestamp first, it just orders by timestamp it seems. And when I set score first, it shows the oldest with the highest score. But I want the newest ones with the highest scores. How do I do that?Sai Raj
11/22/2021, 9:27 AMnpm install -g npm@8.1.4
to update!
s2media_server | npm notice
s2media_server | error Command failed with exit code 1.
s2media_server | info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
s2media_server | error Command failed with exit code 1.
s2media_server | info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
I am getting this error all of a sudden, and I have no clue what's wrong with Prisma, I am using docker-compose
here is the repo I am working on https://github.com/sairaj2119/s2media
can someone help meuser
11/22/2021, 12:33 PMIvan Lukianchuk
11/22/2021, 9:21 PMCharles Gaudreau Jackson
11/22/2021, 10:53 PMJake Choi
11/23/2021, 1:22 AMAbdurrahman
11/23/2021, 5:58 AMAwey
11/23/2021, 7:40 AMmodel Comment {
id Int @id @default(autoincrement())
createdAt DateTime @default(now()) @map("created_at")
updatedAt DateTime @updatedAt @map("updated_at")
content String
author User @relation(fields: [authorId], references: [id])
authorId Int @map("author_id")
post Post @relation(fields: [postId], references: [id])
postId Int @map("post_id")
parent Comment? @relation("CommentToComment", fields: [parentId], references: [id])
parentId Int? @map("parent_id")
replies Comment[] @relation("CommentToComment")
@@map("comments")
}
type Comment {
id: Int!
createdAt: DateTime!
updatedAt: DateTime!
content: String!
author: User!
post: Post!
parent: Comment
replies: [Comment!]
}
Am I representing my Prisma Model correctly with GraphQL?user
11/23/2021, 10:02 AMuser
11/23/2021, 11:28 AMOleg Komarov
11/23/2021, 12:25 PMJames Pickard
11/23/2021, 1:45 PMJames Pickard
11/23/2021, 1:45 PMJames Pickard
11/23/2021, 1:49 PMnpx prisma db pull
and that seems to have updated my schema.prisma but it hasn’t generated a migration, I don’t thinkBenny
11/23/2021, 3:00 PMmodel User {
id String @id
ownership Ownership[]
}
model Ownership {
id String @id @default(cuid())
user User? @relation(fields: [userId], references: [id])
userId String
createdAt DateTime @default(now())
}
When i query a user, i want to return only 1 ownership:
prisma.user.findUnique({
where: {
id: userId,
},
include: {
ownership: {
take: 1,
orderBy: {
createdAt: 'desc',
},
},
},
})
But i want the user.ownership
will be an object, and not array of 1 ownership
element.
i.e
result.ownership = result.ownership[0];
I want to do it for every query for User, so middleware seemed like the best approach but i can see how you can't mutate the return value of the query with middleware.
Any ideas maybe?Aydrian Howard
11/23/2021, 3:29 PMModule not found: Can't resolve '_http_common' in '/opt/build/repo/node_modules/@prisma/client/runtime'
Not sure what's going on. It works in dev mode on my machine.James Pickard
11/23/2021, 3:43 PMimport prismaClientPkg from '@prisma/client';
const PrismaClient = prismaClientPkg.PrismaClient;
James Pickard
11/23/2021, 3:44 PMERROR ServerMiddleware Error: Cannot read property 'PrismaClient' of undefined
Dennis Yurkevich
11/23/2021, 7:25 PM