drizzle-team / drizzle-team/drizzle-orm

[FEATURE]: Allow undefined inside union()

Open
#2,406 2 comments 2 reactions 0 assignees View on GitHub
improvement qb/crud qb/set-operators
Dominant language
TypeScript
Stars
35.8k
Forks
1.6k
Avg merge
2d 7h
Merged PRs (30d)
4

Description

### Describe what you want

It should be possible to do `union(query1, query2, undefined)`.

This would enable conditional logic in the same vein it's possible to use it in filters (e.g. `where(and(eq(id, 1), undefined))`

A side requirement of allowing `undefined` inside `union()` would be to allow passing just 1 argument to `union()`. Right now, it expects 2.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.