-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Description
Feature hasn't been suggested before.
- I have verified this feature I'm about to request hasn't been suggested before.
Describe the enhancement you want to request
A trivial change to the type overloading declarations of the and and or operators used for constructing filters can improve type inference.
See their definitions here.
Note that they return a union SQL | undefined to account for the fact that when the list of clauses being provided are empty the operators return undefined which plugs into drizzle's conditional filtering api (as a separate note, I believe that this is not consistent with conventional logical interpretations of empty disjunctions: undefined seems to indicate that no filter is being applied, whereas an empty disjunction is conventionally equivalent to falsehood, which might be interpreted as everything being filtered out...). There are circumstances when this type can be determined to be narrower, such as when it is known that the list of clauses is non-empty. I suggest that we overload these operators to account for that.