question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Error occurred during query execution: cause: Some(WrongType...

See original GitHub issue

I 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:closed
  • Created 3 years ago
  • Comments:7 (5 by maintainers)

github_iconTop GitHub Comments

2reactions
janpiocommented, Nov 5, 2020

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.

2reactions
cyrus-zacommented, Oct 20, 2020

@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

Read more comments on GitHub >

github_iconTop Results From Across the Web

WRONGTYPE Operation against a key holding the wrong kind ...
When I am trying to access a key by get method then get following error "WRONGTYPE Operation against a key holding the wrong...
Read more >
Database Engine events and errors - SQL Server
Consult this MSSQL error code list to find explanations for error messages for SQL Server database engine events.
Read more >
Fix “WRONGTYPE Operation against a key holding the wrong ...
In this case, the key holds a string (not a hash) and so we get the error. We can verify this with the...
Read more >
SQL20500 - SQL20999 - IBM
The query associated with a cursor variable used in an OPEN or FETCH ... SQL20508N An error occurred during the revalidation of object...
Read more >
Debugging SQL: Syntax Errors animated with Gifs - Data School
When writing SQL queries there are many places where a small mistype can cause you to receive an error. We will review some...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found