Josh
05/15/2021, 10:34 PMyoenho park
05/16/2021, 9:12 AMBeyond
05/17/2021, 4:34 AMMo El
05/17/2021, 7:05 AMjsonColumn
on the user table, it'd be ideal to have typescript checking on what is passed. This would currently fail:
function createUser(someJson: { foo: string, bar: string}) {
prisma.user.create({data: { name: 'joe', jsonColumn: someJson }})
}
Tobias Lins
05/17/2021, 4:06 PM.prisma/client/index.js
.prisma/client/index.d.js
.prisma/client/index-browser.js
.prisma/client/schema.prisma
bajras
05/17/2021, 4:33 PMnpx prisma introspect
to get the schema from my RDS mysql database. But when I run the prima generate
I get bunch of errors. some of them are below:
errors:
error: Type "BigInt" is neither a built-in type, nor refers to another model, custom type, or enum.
id BigInt @id @default(autoincrement())
Error validating model "template_save_images": The index definition refers to the unknown fields template_save_id.
@@index([template_save_id], name: "index_template_save_images_on_template_save_id")
Schema:
model template_save_images {
id BigInt @id @default(autoincrement())
template_save_id BigInt?
s3_url String @unique @db.VarChar(255)
mc_url String? @db.VarChar(255)
thumbnail Boolean @default(true)
frame String @db.VarChar(32)
multiplier Decimal @db.Decimal(5, 2)
created_at DateTime @default(now())
updated_at DateTime @default(now())
template_saves template_saves? @relation(fields: [template_save_id], references: [id])
@@index([mc_url], name: "index_template_save_images_on_mc_url")
@@index([template_save_id], name: "index_template_save_images_on_template_save_id")
}
model template_saves {
id BigInt @id @default(autoincrement())
user_id BigInt?
brand String @db.VarChar(64)
template String @db.VarChar(64)
country String? @db.VarChar(2)
data Json?
shipment_id String? @db.VarChar(32)
source String? @db.VarChar(32)
environment String? @db.VarChar(32)
created_at DateTime @default(now())
updated_at DateTime @default(now())
users users? @relation(fields: [user_id], references: [id])
template_save_images template_save_images[]
@@index([brand, created_at], name: "index_template_saves_brand_created")
@@index([brand, template, created_at], name: "index_template_saves_brand_template_created")
@@index([created_at], name: "index_template_saves_created")
@@index([user_id], name: "index_template_saves_on_user_id")
@@index([shipment_id], name: "index_template_saves_shipment_id")
@@index([template, created_at], name: "index_template_saves_template_created")
@@index([user_id, brand, created_at], name: "index_template_saves_user_brand_created")
@@index([user_id, brand, template, created_at], name: "index_template_saves_user_brand_template_created")
@@index([user_id, created_at], name: "index_template_saves_user_created")
@@index([user_id, template, created_at], name: "index_template_saves_user_template_created")
}
model users {
id BigInt @id @default(autoincrement())
username String @unique @db.VarChar(12)
created_at DateTime @default(now())
updated_at DateTime @default(now())
template_saves template_saves[]
}
ali
05/17/2021, 6:03 PMError:
Invalid `prisma.queryRaw()` invocation:
Your raw query had an incorrect number of parameters. Expected: `0`, actual: `1`.
This happens on the TRUNCATE TABLE
command.
Do the variables need to be formatted differently?Spiros - Product at Prisma
Catalin Pit
05/18/2021, 2:43 PMMatt Leyrat
05/18/2021, 4:46 PMIvano Garcia
05/18/2021, 6:39 PMjsonb
parameter a record using a findMany.
By example ORDER
BY
*name*->> 'en' *asc*
Thanks!Michael Gummelt
05/18/2021, 11:06 PMts-node-dev
is supposed to restart my express server whenever a change is made, but when I construct a PrismaClient
, the server hangs and no longer restarts when source files change. Has anyone experienced this? Running kill
on the server doesn't successfully terminate it, and I've confirmed the problem is some interaction between ts-node-dev
and PrismaClient
, because when running under ts-node
, I can kill
the server just fine.Ethan Zoller
05/19/2021, 12:29 AMsapkra
05/19/2021, 3:00 AMPascal Sthamer
05/19/2021, 7:11 AMError: Timed out fetching a new connection from the pool. Please consider reducing the number of requests or increasing the `connection_limit` parameter (<https://www.prisma.io/docs/concepts/components/prisma-client/connection-management#connection-pool>). Current limit: 10.
They seem to occur randomly and not during high load. Once the error occurs once, it is spammed forever and an application restart is required. I already raised the connection limit to 10, which only made the error occur less frequently.
I checked the database using SHOW PROCESSLIST
and it shows that not a single connection is established.
Another thing I noticed in more recent versions of prisma is that it logs "Fetched a connection from the pool" very often. A single request to the api will show this log line about 10 times.
prisma version: 2.21.2James
05/19/2021, 11:48 AMArun Kumar
05/19/2021, 12:58 PMArun Kumar
05/19/2021, 1:12 PM? - The migration `20210407081334_init` was modified after it was applied.
- Drift detected: Your database schema is not in sync with your migration history.
We need to reset the PostgreSQL database "test" at "01.01.4.01:5432".
Arun Kumar
05/19/2021, 1:13 PMJulien Goux
05/19/2021, 2:29 PMJulien Goux
05/19/2021, 2:30 PMJulien Goux
05/19/2021, 2:31 PMJulien Goux
05/19/2021, 2:31 PMJulien Goux
05/19/2021, 2:31 PMArun Kumar
05/19/2021, 2:44 PMDatabase error code: 42704
Database error:
db error: ERROR: type "bigserial" does not exist
Francesco Sardo
05/19/2021, 3:42 PMArticle
, I can only do so via db.article.update({ where: { id } , data })
I want to be able to add more conditions in the where
clause. Right now, I want to be able to say update({ where: { id, authorId: session.userId }
The alternative is to do another query first to check if the current logged in user is the author, which is not too bad, but an ORM should be able to support complex update logic. Any reason why it's not allowed in Prisma?Arun Kumar
05/19/2021, 4:03 PMJack
05/19/2021, 4:25 PMAlex Vilchis
05/19/2021, 8:32 PMuseSubscription
apollo hooks are creating multiple websocket connections? I see many requests being made on my browser (when in my mind I only need one). Do you guys know anything about websocket connection management?Arun Kumar
05/20/2021, 4:17 AM