Closed jakeleventhal closed 2 months ago
Checking for these kind of conditions adds overhead to the ORM and even if no rows are affected, some developers may still want to execute them because of triggers or for logging purposes. This won't be worked on as the developer should be responsible for running or not running said queries.
Describe what you want
Some drizzle statements, like
inArray(someTable.id, [])
, will evaluate to the following SQL:It is possible to have complex layering of query conditions, but this feature is to propose canceling queries entirely and just resolving the promise for calls that will result in no data, updates, etc.
The goal would be to recursively check all conditions in a WHERE clause and determine if the entire result can be simplified to
false
. If so, never make an attempt to reach the db. This would just speed up some API calls and remove the need to contact the DB in many cases