Gracefully handle incorrect id column type #456
Comments
Error is now
|
What does that mean? |
@janpio Tim told the message should be better, here it's a regression from the engine, the error points out that the ID type is not correct. I'll run again soon as the backend is fixed it :) |
This should be fixed now. Can you test again please @Jolg42 ? 🙏 |
So it looks like from the Prisma Client there is no error provided like before. Reproduction example: Code and SQLite db from:
Latest step of the scripts returns an empty array instead of data Note: The SQLite database need to be reverted (or code modified) after each run because of the unique condition |
It's an internal error stating that one set of fields from a result (table A) can't be rolled over into the opposing sides fields (on table B, FK) because they mismatch. |
@Jolg42 So you're saying it still doesn't work, am I reading this correctly? |
@dpetrick : Yes the query engine returns an empty array when it should find related records instead. |
Not reproducible, I assume this to be fixed through various merges concerning types and core query handling. |
Indeed it works! 🎊
|
As of now, if I have this schema:
And the column
author
inPost
has the typetext
in any SQL database (vs. theInt
that is expected via the User.id column), it won't error, but just can't resolve the relation, returning an empty result set.We should either error in this situation or be able to coerce the type of the
author
column.The text was updated successfully, but these errors were encountered: