TypedSql generating wrong types from the query
* DESCRIPTION
My query returns the chests from the chest table and add to it the numOfKeys the user has for those chests by joining the chestKeys table, while returning the chests , if the user does not have a chestKey record I am explicitly falling back to 0 instead of null
* ISSUE
TypedSql is returning numOfKeys as number | null
* EXPECTED RESULT
TypedSql should return numOfKeys as number
* QUERY
result is in the attached image
4 Replies
Hi @Mohammad Orabi ๐ฑ๐ง
Can you please share your schema file? We have also have users report that the coaleasce function return the wrong type in typedSQL as can be seen in this open issue. As typedSQL is in preview, these kind of issue can be expected so that we can make improvements to it.
GitHub
Issues ยท prisma/prisma
Next-generation ORM for Node.js & TypeScript | PostgreSQL, MySQL, MariaDB, SQL Server, SQLite, MongoDB and CockroachDB - Issues ยท prisma/prisma
here is my related schemas
Thanks for sharing, Iโm taking a look
Thank you very much appreciate it
yes I think its an important issue , as I was forced to cast my type when querying it for typescript to shutup
so that defeats the whole purpose of typedSQL haha