-
-
Notifications
You must be signed in to change notification settings - Fork 26
feat: add support for is_distinct_from and is_not_distinct_from functions #200
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add support for generating SQL IS DISTINCT FROM and IS NOT DISTINCT FROM expressions. - Update AshSql.Expr to handle :is_distinct_from and :is_not_distinct_from operators - Generate proper SQL: "expr1 IS DISTINCT FROM expr2" and "expr1 IS NOT DISTINCT FROM expr2" This enables NULL-safe comparisons in SQL queries generated by AshSql. Related to ash-project/ash#2493
…ions Add SQL translation for Ash.Query.Function.IsDistinctFrom and IsNotDistinctFrom. Changes: - Import IsDistinctFrom and IsNotDistinctFrom functions - Add unified handler for both functions using pattern matching - Generate SQL IS DISTINCT FROM and IS NOT DISTINCT FROM operators - Remove old operator-based handling code Implementation: - Both functions handled in single default_dynamic_expr clause - Uses guard clause: when mod in [IsDistinctFrom, IsNotDistinctFrom] - SQL fragment selection via case statement - Enables NULL-safe comparisons in PostgreSQL queries
zachdaniel
reviewed
Jan 1, 2026
zachdaniel
reviewed
Jan 1, 2026
zachdaniel
requested changes
Jan 1, 2026
Contributor
zachdaniel
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Small changes requested but otherwise looks great!
Co-authored-by: Zach Daniel <zachary.s.daniel@gmail.com>
Co-authored-by: Zach Daniel <zachary.s.daniel@gmail.com>
Contributor
Author
|
Done! Ready for another look. 👍 |
Contributor
|
🚀 Thank you for your contribution! 🚀 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Depends on ash-project/ash#2497
Summary
Add SQL translation for
is_distinct_fromandis_not_distinct_fromfunctions to PostgreSQL'sIS DISTINCT FROMandIS NOT DISTINCT FROMoperators.Example
Contributor checklist
Leave anything that you believe does not apply unchecked.