npm install && npx prisma migrate dev && npx prisma db seed
npm run dev to start the next app
Expected behavior
Expected Generated Types for scalar lists such as text[]integer[]json[] to be nullable
Model Definition
...
generator kysely {
provider = "prisma-kysely"
}
...
model TestModel {
id Int @id @default(autoincrement())
list1 String[]
list2 Int[]
list3 Json[]
}
Postgres schema inspected after running prisma migrations
Versions:
@prisma/client: ^5.12.1
kysely: ^0.27.3
next: 14.2.2
prisma-extension-kysely: ^2.1.0
Additional context
Noticed this bug when my website crashed in prod, I was able to reproduce this bug pretty easily and I don't think its a prisma/prisma-keysely version issue.
I have two api's that I'm calling which do almost the same query but one is through prisma the other one is through prisma-kysely
You can find the api endpoints at /api/test and /api/test-kysely in my example repo. please follow the setup instructions mentioned in the "To Reproduce" section.
If someone can point me in the right direction I will be more than happy to dig into this and hopefully create a PR to solve this in the near future
This is most probably a kysely and/or prisma issue. The way of handling types differ between prisma and kysely, which is why you may need to do some cast.
Describe the bug
nullable columns reported as non nullable
To Reproduce
clone this example repo and
docker compose up
to start postgresnpm install && npx prisma migrate dev && npx prisma db seed
npm run dev
to start the next appExpected behavior
Expected Generated Types for scalar lists such as
text[]
integer[]
json[]
to be nullableModel Definition
Postgres schema inspected after running prisma migrations
Versions:
Additional context
Noticed this bug when my website crashed in prod, I was able to reproduce this bug pretty easily and I don't think its a prisma/prisma-keysely version issue.
I have two api's that I'm calling which do almost the same query but one is through prisma the other one is through prisma-kysely
and here's what the result looks like:
prisma select
prisma-kysely select
and here's what the reported types look like:
prisma select
prisma-kysely select
You can find the api endpoints at
/api/test
and/api/test-kysely
in my example repo. please follow the setup instructions mentioned in the "To Reproduce" section.If someone can point me in the right direction I will be more than happy to dig into this and hopefully create a PR to solve this in the near future