Skip to content

Commit d9455e5

Browse files
committed
fix: allow 'not' to accept SQL | undefined from 'and'/'or'
1 parent 4aa6ecf commit d9455e5

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

drizzle-orm/src/sql/expressions/conditions.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,10 @@ export function or(
174174
* .where(not(inArray(cars.make, ['GM', 'Ford'])))
175175
* ```
176176
*/
177-
export function not(condition: SQLWrapper): SQL {
177+
export function not(condition: SQLWrapper | undefined): SQL | undefined {
178+
if (condition === undefined) {
179+
return undefined;
180+
}
178181
return sql`not ${condition}`;
179182
}
180183

0 commit comments

Comments
 (0)