Skip to content

Fix nested PartialModel null detection for optional fields#3039

Merged
tyt2y3 merged 3 commits intoSeaQL:masterfrom
WaterWhisperer:partial-model-null-detection
Apr 8, 2026
Merged

Fix nested PartialModel null detection for optional fields#3039
tyt2y3 merged 3 commits intoSeaQL:masterfrom
WaterWhisperer:partial-model-null-detection

Conversation

@WaterWhisperer
Copy link
Copy Markdown
Contributor

PR Info

New Features

Bug Fixes

  • Fix DeriveModel null detection for nested partial models when the nested model contains optional fields.

a nested Option<Model> loaded through a left join could incorrectly fail with Missing value for column 'id' if the nested model itself had Option<T> fields.

Breaking Changes

Changes

  • update DeriveModel null-check generation to account for nested Option depth
  • add test for async sea-orm and sea-orm-sync

@WaterWhisperer WaterWhisperer force-pushed the partial-model-null-detection branch from f82b7d8 to fdb8d3a Compare April 6, 2026 13:40
@Huliiiiii Huliiiiii requested a review from tyt2y3 April 6, 2026 17:15
@Huliiiiii Huliiiiii force-pushed the partial-model-null-detection branch from 708e3c4 to 54870a6 Compare April 6, 2026 21:08
@Huliiiiii Huliiiiii requested a review from Expurple April 7, 2026 03:59
@tyt2y3 tyt2y3 merged commit d516c73 into SeaQL:master Apr 8, 2026
39 checks passed
@WaterWhisperer WaterWhisperer deleted the partial-model-null-detection branch April 9, 2026 01:51
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.

FromQueryResult fails for PartialModel when having nested Option<Model> where the nested Model has optional fields

3 participants