Error occurred during query execution: cause: Some(WrongType...
See original GitHub issueI am busy switching from sequelize to prisma. Most of it works, but there’s a custom data type of interval
that we’ve been using in sequelize. We use this package.
When I ran prisma instrospect
it generated type String?
which is obviously wrong.
I get a pretty useless error message when I run into this.
Error occurred during query execution:
ConnectorError(ConnectorError { user_facing_error: None, kind: QueryError(Error { kind: FromSql(7), cause: Some(WrongType { postgres: Interval, rust: "core::option::Option<alloc::string::String>" }) }) })
at PrismaClientFetcher.request (/node_modules/@prisma/client/src/runtime/getPrismaClient.ts:1223:15)
at processTicksAndRejections (internal/process/task_queues.js:82:5)
My model has over 100 fields on it and I had to figure out which field was causing it by process of elimination.
Reading the error message again after figuring the issue out I saw “Interval” was in there, but it was not clear that it’s a data type of Interval causing it, nor did it say which field in my selection was causing it. I’d suggest some better error message in general when a specific selection fails.
I’d also like to request that Prisma can handle Interval data types for postgres
Issue Analytics
- State:
- Created 3 years ago
- Comments:7 (5 by maintainers)
Interval types are not supported at all (see https://github.com/prisma/prisma-client-js/issues/917 for a request to fix that), so whatever is introspected or any queries run against these fields have undefined and probably broken behavior.
@janpio here’s the issue as requested: https://github.com/prisma/prisma-client-js/issues/917
I’ll rename this one to match the error handling