Skip to content

Add null Safe equal Filter method#312

Open
nwcm wants to merge 2 commits into
beyond-the-cloud-dev:mainfrom
nwcm:equalNullSafe
Open

Add null Safe equal Filter method#312
nwcm wants to merge 2 commits into
beyond-the-cloud-dev:mainfrom
nwcm:equalNullSafe

Conversation

@nwcm

@nwcm nwcm commented Jun 19, 2026

Copy link
Copy Markdown
Contributor

Description

Currently Filter.equal() is not null safe. Calling Filter.with('Field__c').equal(couldBeNullVariable)

May result in Field__c = NULL which will include out of scope records unless additional .isNotNull().

This is not a breaking change, just an optional method which developers can chose to implement.

At the moment it dynamically chooses between Field__c = value and Field__c != NULL based on the input variable. We could add both conditions over this dynamic placement.

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update
  • Code refactoring
  • Test improvements
  • CI/CD improvements

Changes Made

  • Adds Filter.equalNullSafe(Object)
  • Adds HavingFilter.equalNullSafe(Object)

Related Issues

n/a

Testing

  • All existing tests pass (npm test)
  • Added new tests for new functionality
  • Tested in scratch org
  • Linting passes (npm run lint)
  • Code formatting is correct (npm run prettier:verify)

Screenshots

Checklist

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code where necessary
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings or errors
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published

Additional Notes

@vercel

vercel Bot commented Jun 19, 2026

Copy link
Copy Markdown

@nwcm is attempting to deploy a commit to the Beyond The Cloud Team on Vercel.

A member of the Team first needs to authorize it.

@nwcm
nwcm marked this pull request as ready for review June 19, 2026 05:34
@pgajek2

pgajek2 commented Jun 19, 2026

Copy link
Copy Markdown
Member

Hi!

To do that, we can use ignoreWhen.

https://soql.beyondthecloud.dev/soql/api/soql-filter#ignorewhen

@nwcm

nwcm commented Jun 21, 2026

Copy link
Copy Markdown
Contributor Author

Ah I missed that one. Thought it was only on FilterGroup.

Personally, I like the idea of having a clean single method on Filter but this will work

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.

2 participants