Type 'string[]' is not assignable to type 'string'.ts(2322) when trying to create a form using Prism
so I'm trying to create a submitForm using prisma, react-hook-form and zod and mysql as my database. But the problem I'm encountering right now is I get this error on form-submit.ts
Type 'string[]' is not assignable to type 'string'.ts(2322)
I know this comes from my schema.prisma, because upon reading the docs, on Scalar https://www.prisma.io/docs/orm/reference/prisma-schema-reference#-modifier
Since my zod accepts array.
form-submit.ts
Prisma Schema API | Prisma Documentation
API reference documentation for the Prisma Schema Language (PSL).
1 Reply
Since MySQL doesn't support scalat lista natively, you could replace your schema with an
enum
if you definitely need to insert an array of strings into your databae with prisma.