json column type mismatch when using db.query
Hey all i have a schema with a json column, when I import the table records the type is inferred as 'unknown'. Any ideas on how to get this working, or do I have to infer the types manually?
Thank you!
3 Replies
ohhh I think i need to use the helper:
.$type<{ foo: string }>()
https://orm.drizzle.team/docs/column-types/mysql#jsonMySQL column types - Drizzle ORM
Drizzle ORM is a lightweight and performant TypeScript ORM with developer experience in mind.
Still having issues:
Gives me a long typescript error complaining about the json column being mismatched
this is how I define my types and schema:
I'll cast the type for now using
as