Skip to content

feat: implement IS DISTINCT FROM expression#21

Merged
tisonkun merged 2 commits intomainfrom
feature/is-distinct-from
Feb 24, 2026
Merged

feat: implement IS DISTINCT FROM expression#21
tisonkun merged 2 commits intomainfrom
feature/is-distinct-from

Conversation

@tisonkun
Copy link
Copy Markdown
Collaborator

No description provided.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This pull request implements the SQL IS DISTINCT FROM and IS NOT DISTINCT FROM operators for the PostgreSQL query builder. These operators are useful for null-safe comparisons where NULL values are treated as comparable values (unlike regular equality operators where NULL = NULL is false).

Changes:

  • Added is_distinct_from() and is_not_distinct_from() methods to the Expr API
  • Added IsDistinctFrom and IsNotDistinctFrom enum variants to BinaryOp
  • Updated SQL rendering and operator precedence logic to support the new operators

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
pqb/src/expr.rs Added implementation of IS DISTINCT FROM operators including enum variants, public API methods, SQL rendering, and precedence handling
pqb/tests/expr.rs Added comprehensive test coverage for the new operators with basic usage and complex expression scenarios

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Signed-off-by: tison <wander4096@gmail.com>
@tisonkun tisonkun enabled auto-merge (squash) February 24, 2026 08:32
@tisonkun tisonkun merged commit 9bc26c3 into main Feb 24, 2026
9 checks passed
@tisonkun tisonkun deleted the feature/is-distinct-from branch February 24, 2026 08:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants