Skip to content

feat(Casts): delegate null handling to custom casts - #279

Merged
elpete merged 3 commits into
nextfrom
fix/275-cast-null-values
Aug 22, 2026
Merged

feat(Casts): delegate null handling to custom casts#279
elpete merged 3 commits into
nextfrom
fix/275-cast-null-values

Conversation

@elpete

@elpete elpete commented Aug 22, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • invoke configured custom casts for database null values by default
  • preserve native nulls and configured null sentinels in BooleanCast
  • safely support cast getters and setters that return native null
  • add regression coverage with a custom null-aware cast

Fixes #275.

This incorporates the core direction discussed in #276 while adding BooleanCast compatibility and tests.

Test-first reproduction

Before the implementation, allows custom casts to handle null database values failed because the custom cast received no opportunity to transform the null value (expected casted-null, received an empty string). The test passes after the change.

The BooleanCast regression is covered through the normal Quick entity flow: load the nullable column with find(), read it through the entity null/accessor APIs, update an unrelated attribute, refresh, and verify the Boolean attribute remains null.

Verification

  • qb@be resolved locally to 14.0.0-beta.3
  • AttributeCastsSpec: 14 passed, 1 known unrelated qb 14 compatibility failure
  • NullValuesSpec: 5 passed, 0 failed
  • GitHub Actions: all 12 engine/ColdBox combinations passed, including Lucee 5/6, Adobe 2021/2023/2025, and BoxLang CFML
  • GitHub Actions formatting and security checks passed
  • box run-script format:check
  • git diff --check

@elpete
elpete marked this pull request as ready for review August 22, 2026 02:08
@elpete
elpete merged commit 914bfaf into next Aug 22, 2026
14 checks passed
@elpete
elpete deleted the fix/275-cast-null-values branch August 22, 2026 02:09
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.

1 participant