Closed codygordon closed 5 months ago
This has been answered many times. It's impossible to fix this for anything other than trivial cases, and even that fix would complicate the types a lot and basically make the library unusable. The query builder type would be changed by where
calls, making reassignment to the same variable often impossible. All that just to fix trivial one condition expressions. As soon as there's a more complex where statement, it wouldn't be possible anymore.
I just added an example for dealing with these cases
Thank you, appreciate the response!
Take this expression builder example:
The
contentPermission
table definition hasfolderId
as a nullable column, so TS is throwing an error as thefolderId
type does not exactly match the "parent" queryid
column type (not nullable), however we know the union result would never result in any null values due to the where statement..
In lieu of a fix, is there a recommended workaround for this situation?